Skip to content

Instantly share code, notes, and snippets.

@Saren-Arterius
Last active September 26, 2024 01:05
Show Gist options
  • Save Saren-Arterius/c5bc39199552a5c244449b0ce467d6b6 to your computer and use it in GitHub Desktop.
Save Saren-Arterius/c5bc39199552a5c244449b0ce467d6b6 to your computer and use it in GitHub Desktop.
Install Waydroid on Steam Deck (As of 2024-03-16)

Waydroid on Steam Deck

What to expect

  • 60fps native Android 11 with hardware 3d/graphics acceleration on Steam Deck
    • gapps to use google play
    • libndk to support arm applications
  • Youtube, easier to use browser apps, genshin impact, honkai starrail
  • Controller support
  • Multitouch support
  • Works on OLED model

Host side stuff

  • cage-git as wrapper and wlr-randr to adjust resolution
  • nopasswd udev trigger helper
  • "Touchscreen native support" as always on command

Caveats

  • 60fps max although my screen is 90hz, seems to be waydroid setup issue
  • Do not expect data or the setup to be permanent
    • Steamos update may kill the setup, need to install waydroid again
    • Reinstalling waydroid may upgrade waydroid, and new waydroid maybe incompatible with older setup, need to nuke the install to proceed
  • Entering settings app crashes and reboots the steam deck immediately
  • In some cases the session will not spawn again. Need to run sudo systemctl restart waydroid-container or reboot to fix
  • To exit the session (prevent unwanted resource usage), Need to run sudo systemctl stop waydroid-container or reboot
  • Not every android application is compatible, escpecially latest games, expect black screen on some apps (3dmark wild life benchmark etc)
    • Seems black screen issue is no longer for many apps as tested on 2024-03-15
    • Even if games work, do not expect physical controller support (nor good performance for heavy games)
  • Waydroid may not start after deck reboot. In some cases sudo systemctl stop waydroid-container then sudo ln -s /dev/binder /dev/anbox-binder OR sudo ln -s /dev/binderfs/anbox-binder /dev/binder might fix this.
    • To permanently fix this, nuke waydroid and waydroid init -f, as your /var/lib/waydroid may be too old.

Setup requirements

  • not be afraid of linux commands and easy access (ssh, physical keyboard etc)
  • steamos sudo password already set

Setup

  1. Run setup-waydroid-steamos3.5.sh (copy commands line by line [recommended], or execute directly)
  2. Add Waydroid.sh to /home/deck
  3. Add /home/deck/Waydroid.sh as non-steam game at gamemode
  4. Launch waydroid from menu
  5. sudo waydroid-extras -a 11 certified to make play store available

Enable native touchscreen (multi touch) support

  1. Go to Waydroid.sh controller settings
  2. Click "Actions sets" at bottom of of left sidebar
  3. Click "Add Always On Command"
  4. Click "System" tab
  5. "Touchscreen native support"
  6. Go back

Controller support

Verified with "Game Controller Tester" and works partially with Minecraft Education Edition (except LT and RT buttons).

Android gaming is in a sad state, and controller support in Android games is even more sad. It's likely you will need a controller mapper app. (Hint: Mantis Gamepad Pro APK).

However, you got a Steam Deck, why not try PC games with proper controller support instead?

Nuke (Wipe waydroid install)

  1. sudo rm -rf /var/lib/waydroid/*
  2. sudo rm -rf ~/.local/share/applications/aydroid ~/.local/share/waydroid

Old Info

Controller support

See waydroid/waydroid#289 (comment)

  1. sudo sh -c 'echo -e "persist.waydroid.udev=true\npersist.waydroid.uevent=true" >> /var/lib/waydroid/waydroid_base.prop'
  2. Restart waydroid by sudo systemctl restart waydroid-container.service
  3. After entered android, run $ sudo sh -c 'for i in $(seq 7 9); do echo add > /sys/class/input/event$i/uevent; done'
# Install Waydroid on Steam Deck
# use any method to SSH in, or you may type commands below manually
sudo steamos-readonly disable
# Incase of corrupted signatures
sudo pacman-key --populate holo
# Build deps
sudo pacman -S git base-devel dkms linux-neptune-61 linux-neptune-61-headers cmake glibc --overwrite='/*'
# Reinstall stripped deps
sudo pacman -S libisl libmpc glib2 linux-api-headers python3 wayland wayland-utils systemd-libs libxkbcommon libxcb pixman xcb-util-wm pacman libarchive
# Install yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# gbinder requires cython0 but not renamed yet on steamos
yay -S libgbinder --overwrite='/*'
cd /tmp
git clone https://aur.archlinux.org/python-gbinder.git
cd python-gbinder
sed -i 's/cython0/cython/g' PKGBUILD
makepkg -si
yay -S waydroid waydroid-script-git binder_linux-dkms wlr-randr --overwrite='/*'
cd /tmp
git clone https://aur.archlinux.org/cage-git.git
cd cage-git
sed -i 's/cage\.git/cage.git#commit=34eb3ec2c81fde3349eed63daba8b244b0bfd46f/g' PKGBUILD
makepkg -si
# Firewall
sudo firewall-cmd --zone=trusted --add-interface=waydroid0
sudo firewall-cmd --zone=trusted --add-port=53/udp
sudo firewall-cmd --zone=trusted --add-port=67/udp
sudo firewall-cmd --zone=trusted --add-forward
sudo firewall-cmd --runtime-to-permanent
# Cleanup
rm -rf /tmp/python-gbinder/tmp/yay /tmp/cage-git
sudo ln -s ~/waydroid-extra /usr/share/
########## SKIP ALL BELOW IF REINSTALL WAYDROID AFTER UPGRADING STEAMOS ##########
mkdir ~/var-lib-waydroid waydroid-extra
sudo ln -s ~/var-lib-waydroid /var/lib/waydroid
# Wipe waydroid install
# sudo rm -rf /var/lib/waydroid/*
# sudo rm -rf ~/.local/share/applications/*aydroid* ~/.local/share/waydroid
sudo waydroid init
cd /opt/waydroid-script
sudo waydroid-extras -a 11 install gapps libndk
sudo systemctl restart waydroid-container.service
# Controller helper
sudo sh -c 'grep persist.waydroid.udev /var/lib/waydroid/waydroid_base.prop || echo -e "persist.waydroid.udev=true\npersist.waydroid.uevent=true" >> /var/lib/waydroid/waydroid_base.prop'
sudo sh -c 'echo -e "#!/bin/bash\nsleep 15;echo add > /sys/devices/virtual/input/input*/event*/uevent" > /usr/local/bin/waydroid-helper'
sudo chmod +x /usr/local/bin/waydroid-helper
sudo sh -c 'echo -e "%wheel ALL = (root) NOPASSWD: /usr/local/bin/waydroid-helper" > /etc/sudoers.d/zz-waydroid'
#!/bin/sh
cage -- bash -c 'wlr-randr --output X11-1 --custom-mode 1280x800; sleep 1; sudo /usr/local/bin/waydroid-helper & waydroid show-full-ui'
@kestr31
Copy link

kestr31 commented Jul 28, 2023

Can

Thank you for the script and the readme.
However, I'm afraid that just running this script seems to cause an error when building python-gbinder.
Error is shown as following:

==> Making package: python-gbinder 1.1.1-4 (Thu 27 Jul 2023 10:47:42 PM KST)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: libgbinder
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> libgbinder
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.

I think that the cause of the problem is just as shown in the message and I think there might be something missing in the tutorial.
May I ask what am I doing wrong about this?

can you do yay -S libgbinder --overwrite='/*' and see if it works?

This gives me

AUR Dependency (1): libglibutil-1.0.71-1
AUR Explicit (1): libgbinder-1.1.34-1
:: PKGBUILD up to date, skipping download: libgbinder
:: PKGBUILD up to date, skipping download: libglibutil
  2 libglibutil                      (Build Files Exist)
  1 libgbinder                       (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)

[ADD]

It seems build dependencies were missing for building a new package.

I installed them (cmake, linux-api-headers glibc) to fix it reading following reference.

Reddit - For compiling C++ code

sudo pacman -S cmake linux-api-headers glibc

Then, I checked all for command you have suggested and build packages from source.

Not the previous issue is solved. However, I am still facing this issue:

 python-jaraco.te...    17.4 KiB  19.4 KiB/s 00:01 [##################] 100%
(16/16) checking keys in keyring                   [##################] 100%
(16/16) checking package integrity                 [##################] 100%
error: python-jaraco.text: signature from "Chih-Hsuan Yen <[email protected]>" is unknown trust
:: File /var/cache/pacman/pkg/python-jaraco.text-3.9.1-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> python-setuptools
  -> cython
==> ERROR: Could not resolve all dependencies.

[ADD]

This was due to problem of not-synced repository for steam deck.

Based on following, reference, I temporary turned-off warning for package signing:

DANIELE MTE90 SCASCIAFRATTE - HOW TO GET OPENRAZER WORKING EASILY ON STEAM DECK

  • /etc/pacman.conf
SigLevel = Never
#LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

I also needed poetry for proper build of line 25

sudo pacman -S poetry

Build works well now after this.

The Last error is the python module import error as following:

Traceback (most recent call last):
  File "/usr/bin/waydroid-extras", line 2, in <module>
    from InquirerPy import inquirer
ImportError: cannot import name 'inquirer' from 'InquirerPy' (unknown location)

[ADD]

Hopefully, this was a problem of messed up python package dependencies.

After setting up pip as reference below, I re-installed the InquierPy package after removing it.

Reddit - How do I do a "pip3" install?

Now it works.

Sadly, Blue Archive does not run showing only black screen.

@DarkenLX
Copy link

DarkenLX commented Aug 2, 2023

What is the exact cause of the Entering settings app crash in the first place?

@andre1892
Copy link

Still new at Linux Architecture and Steamdeck!
Try to got your Script Working but Ive got some Errors (At the End "Waydroid" Path of your Script (Could not find the Waydroid Path/Folders)
Ist theyre anyway to make an Noob Friendly Guide/Video for this Kind ? Thanks

@DarkenLX
Copy link

Suggestion for some of the required dependencies (libgbinder, python-gbinder, glibutil etc) it might be better to use the
AUR repo here: (information for adding it via pacman is there as well)
https://aur.chaotic.cx/
It has a lot of AUR packages pre built for Arch and Arch based OS. As some dependencies don't always want to compile.

@PeterKW
Copy link

PeterKW commented Sep 9, 2023

I'm getting dependency errors I don't quite know how to debug further? Any suggestions? Not quite sure how much is relevant so sorry for large code block.

==> Starting build()...
/home/deck/.cache/yay/libglibutil/PKGBUILD: line 23: make: command not found
==> ERROR: A failure occurred in build().
    Aborting...
 -> Failed to install layer, rolling up to next layer.error:error making: libglibutil - exit status 4
==> Making package: libgbinder 1.1.34-1 (Sat Sep  9 06:46:43 2023)
==> Checking runtime dependencies...
==> Missing dependencies:
  -> libglibutil
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.
 -> error making: libgbinder-exit status 8
==> Making package: libglibutil 1.0.71-1 (Sat Sep  9 06:46:46 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating libglibutil git repo...
==> Validating source files with sha512sums...
    libglibutil ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of libglibutil git repo...
Cloning into 'libglibutil'...
done.
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Sources are ready.
==> Making package: libglibutil 1.0.71-1 (Sat Sep  9 06:46:52 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
/home/deck/.cache/yay/libglibutil/PKGBUILD: line 23: make: command not found
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: libglibutil-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
libgbinder - exit status 8
libglibutil - exit status 4
Cloning into 'python-gbinder'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 35 (delta 8), reused 35 (delta 8), pack-reused 0
Receiving objects: 100% (35/35), 5.81 KiB | 5.81 MiB/s, done.
Resolving deltas: 100% (8/8), done.
==> Making package: python-gbinder 1.1.1-4 (Sat Sep  9 06:46:56 2023)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: libgbinder
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> libgbinder
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (16) python-appdirs-1.4.4-7  python-autocommand-2.2.1-1
...

Total Installed Size:  21.41 MiB

:: Proceed with installation? [Y/n] y
(16/16) checking keys in keyring                   [#############] 100%
(16/16) checking package integrity                 [#############] 100%
error: python-jaraco.functools: signature from "Chih-Hsuan Yen <[email protected]>" is unknown trust
:: File /var/cache/pacman/pkg/python-jaraco.functools-3.5.2-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: python-jaraco.text: signature from "Chih-Hsuan Yen <[email protected]>" is unknown trust
:: File /var/cache/pacman/pkg/python-jaraco.text-3.9.1-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> python-setuptools
  -> cython
==> ERROR: Could not resolve all dependencies.
 -> No AUR package found for cython0
 -> could not find all required packages: cython0 
mkdir: cannot create directory 'waydroid-extra': No such file or directory
sudo: waydroid: command not found
./setup-waydroid.sh: line 37: cd: /opt/waydroid-script: No such file or directory
sudo: waydroid-extras: command not found
Failed to restart waydroid-container.service: Unit waydroid-container.service not found.



@rafrafek
Copy link

genshin impact works on my steam deck with the latest proton experimental, no android needed :)

@Saren-Arterius
Copy link
Author

Most of my modifications were wiped by steamos update so I reinstalled it again. I just found that cmake and glibc need to be (re)installed as well as @kestr31 mentioned. I have not encountered other dependencies issues like comments above.

@Saren-Arterius
Copy link
Author

Do NOT follow this tutorial if on steamOS >= 3.5

@elpendor
Copy link

Do NOT follow this tutorial if on steamOS >= 3.5

What's the issue with 3.5?

Is there any way to install it on 3.5 then?

@max06
Copy link

max06 commented Oct 23, 2023

@Saren-Arterius I'd like to offer my help! Steam-deck at hands and I'd love to run android on it. And I know a bit about linux and stuff :)

@ryanrudolfoba
Copy link

ryanrudolfoba commented Nov 6, 2023

hi there i've been messing around with waydroid android on steamos 3.5.1 using mostly the archwiki and help from bazzite devs.

i've created a video on how i installed waydroid on steamos 3.5.1 -
https://youtu.be/9M5Gtiucn-U?si=AwG-nqb6pHusgRUv

and some demo game play -
https://youtu.be/0xIp8Er3tjY?si=_4sP8uYX-q0_UTWD

im having issues with the casualsnek script on SteamOS, i dunno if it is because 3.5.1? On my fedora install the casualsnek works fine.

my workaround is manually mounting the system.img and copying the libndk files to it.

have you also tried libhoudini? which is better libhoudini or libndk? because i cant get the casualsnek script to work on SteamOS 3.5.1 it will be time consuming to remove libndk and replace with libhoudini.

EDIT: i forgot to mention that the bazzite devs linked your gist so here i am :)

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 7, 2023

hi there i've been messing around with waydroid android on steamos 3.5.1 using mostly the archwiki and help from bazzite devs.

i've created a video on how i installed waydroid on steamos 3.5.1 - https://youtu.be/9M5Gtiucn-U?si=AwG-nqb6pHusgRUv

and some demo game play - https://youtu.be/0xIp8Er3tjY?si=_4sP8uYX-q0_UTWD

im having issues with the casualsnek script on SteamOS, i dunno if it is because 3.5.1? On my fedora install the casualsnek works fine.

my workaround is manually mounting the system.img and copying the libndk files to it.

have you also tried libhoudini? which is better libhoudini or libndk? because i cant get the casualsnek script to work on SteamOS 3.5.1 it will be time consuming to remove libndk and replace with libhoudini.

EDIT: i forgot to mention that the bazzite devs linked your gist so here i am :)

Hello there, I am actually using casualsnek/waydroid_script too. I think your issue
is the path, which the script actually required you to cd /opt/waydroid-script first, which I did before sudo waydroid-extras -a 11 install gapps libndk and it worked for me.

As for libhoudini, libhoudini performance is far worse than libndk since we are on AMD CPU. It's the difference of 30fps vs 5fps in Honkai Starrail.

The only problem I am experiencing is the native touch stopped working properly which it did in 3.4.X. I need that for multitouch games so the default "touchscreen to cursor to waydroid touchscreen" is not good enough.

@ryanrudolfoba
Copy link

ryanrudolfoba commented Nov 7, 2023

Thanks for feedback i'll try tinker around with the casualsnek script. I didnt install the AUR version, i just use the git version and manually doing sudo venv/bin/python3 main.py install libndk

I wouldnt bother then with libhoudini and just stick to libndk. As for the multitouch im using weston instead of plasma nested and it didnt work in weston too. I thought its because of a weston config im missing. But since you confirmed it doesnt work for you too then its something else.

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 8, 2023

Thanks for feedback i'll try tinker around with the casualsnek script. I didnt install the AUR version, i just use the git version and manually doing sudo venv/bin/python3 main.py install libndk

I wouldnt bother then with libhoudini and just stick to libndk. As for the multitouch im using weston instead of plasma nested and it didnt work in weston too. I thought its because of a weston config im missing. But since you confirmed it doesnt work for you too then its something else.

Multitouch did work in steamos 3.4.10 with "Touchscreen native support". Tried nested plasma and weston it both worked. I don't know if it's steamos 3.5's problem, or some waydroid update broke it.

I can isolate the problem (downgrade steamos to see if it's steamos or waydroid's problem, if it's waydroid's problem find which commit caused it) but it will take so much effort to do so

@ryanrudolfoba
Copy link

No worries i'll stick to testing on SteamOS 3.5

@ryanrudolfoba
Copy link

I downgrade my SteamOS to 3.4.11. here are interesting things -

casualsnek script works fine on 3.4.11 so this leads me to believe that the issue is on 3.5.x

weston on 3.4.11 is old and has touchscreen issue like the pointer response is way off from where i touch the screen. Using weston from 3.5.1 works

firewall-cmd doesnt exist on 3.4.11 and no need to configure firewall

im not building waydroid from yay but from AUR git. Something changed as now on both 3.4.11 and 3.5.2 it complains that /dev/anbox-binder is missing. I had to make a symlink for waydroid to work. At first i thought its the kernel in 3.5.2 but issue also happens in 3.4.11

@Igilq
Copy link

Igilq commented Nov 15, 2023

After launching both scripts and after downloading things they need to launch waydroid, downloads became corrupted and after restarting it for Many times it was the same

@emilmichaiel
Copy link

I downgrade my SteamOS to 3.4.11. here are interesting things -

casualsnek script works fine on 3.4.11 so this leads me to believe that the issue is on 3.5.x

weston on 3.4.11 is old and has touchscreen issue like the pointer response is way off from where i touch the screen. Using weston from 3.5.1 works

firewall-cmd doesnt exist on 3.4.11 and no need to configure firewall

im not building waydroid from yay but from AUR git. Something changed as now on both 3.4.11 and 3.5.2 it complains that /dev/anbox-binder is missing. I had to make a symlink for waydroid to work. At first i thought its the kernel in 3.5.2 but issue also happens in 3.4.11

casualsnek script did not work for me on 3.5.1 either, however when I tried out the system.img and vendor.img from The Chinese repo it did work I do not know what is special in those imgs.
I simply downloaded the archive file, pulled both system.img and vendor.img and copied them to /etc/waydroid-extra/images then sudo waydroid init -f (this was on waydroid-image-gapps-18.1_20231104-1-x86_64.pkg.tar.zst file, there is a newer version by the time of this comment)

here are my findings

  • touches worked as a mouse clicks (this can by overcome adding faketouch in the wayland prop, to emulate mouse clicks as taps, by adding persist.waydroid.fake_touch=*.* in the wayland_base.prop file if i am not mistaken, or by typing this command via cli waydroid prop set persist.waydroid.fake_touch '*.*' )
  • multi touch support did not work
  • for controller support, RT and LT somehow were registering as right analog stick axis

I gave up on Waydroid, as multitouch support is a deal breaker for me

I am currently experimenting emulations (3.5.4, steamos on readonly mode)
I managed to run android 11 on genymotion with libndk and libhoudini good performance on libndk but again no multitouch support nor controller support.

I managed to bootup and install bliss os 15 (Android 12) and Android_x86 (Android 9) via qemu running on an ubuntu container inside distrobox (great performance), but

  • no multitouch support
  • controller pass through did not work (the controller was acting like I was in the desktop mode emulating mouse trackpad, scrolls and clicks ...etc)
  • passing througth external controllers works

@donlinglok1
Copy link

I am in 3.5.6 version and try both script but unluck.

However, i found this repo and success to install the waydroid, hope can help if you go unluck too.
https://github.com/ryanrudolfoba/SteamOS-Waydroid-Installer

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 23, 2023

3.5.7 with OLED model. Dropped plasma wrapper in favor of cage-git, now native touchscreen support with multitouch works.

@wareya
Copy link

wareya commented Dec 8, 2023

The python-inquirerpy and python-pfzy packages on the AUR currently fail to import in the waydroid-extras script and you have to manually install old versions via their PKGBUILD.

@HinataNekoNya
Copy link

HinataNekoNya commented Dec 13, 2023

Hello im sorry but y try to install magisk im on SteamOS with a SteamDeck but the magisk script don't work (he just install magisk delta manager)

this is the error he give

lxc-attach: waydroid: ../src/lxc/attach.c: lxc_attach_run_command: 1841 No such file or directory - Failed to exec "su"

PS: i want root for "Mantis Gamepad Pro APK"

@nille02
Copy link

nille02 commented Jan 20, 2024

The python-inquirerpy and python-pfzy packages on the AUR currently fail to import in the waydroid-extras script and you have to manually install old versions via their PKGBUILD.

How? I did try the aur packages too and i also did try the packages from pip both are not working.

@Saren-Arterius
Copy link
Author

Updated for SteamOS 3.5.17.

@Kuroikitten
Copy link

Hello, as of 17.04.2024 this method doesn't work on my steamos. The error occurs at:

# Install yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

And the error is:

error: target not found: pacman>6.1
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> pacman>6.1
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment