Skip to main content

Running Android apps on Linux

Configuring and running Waydroid

# Installing, setting up and running the linux-zen (a kernel that includes the necessary modules for Waydroid)
sudo pacman -S linux-zen
sudo grub-mkconfig -o /boot/grub/grub.cfg
reboot

# Installing waydroid and configuring it
yay waydroid
sudo waydroid init
sudo sed -i 's/ro.hardware.gralloc=gbm/ro.hardware.gralloc=minigbm_gbm_mesa/g' /var/lib/waydroid/waydroid_base.prop
sudo systemctl enable --now waydroid-container

# Installing libndk to be able to properly install apps
git clone --depth=1 https://github.com/casualsnek/waydroid_script.git
cd waydroid_script
python -m venv .venv # creating a virtual env to install python dependencies
.venv/bin/pip install -r requirements.txt
sudo python main.py
# select android 11 and libndk

# if you're on wayland:
waydroid show-full-ui

# else
sudo pacman -S weston # weston is a program that will created a nested wayland session inside Xorg
weston
waydroid show-full-ui # Run this command inside weston's terminal

Installing apps

In order to install apps, you can open the browser in Waydroid then download and install apk from there. Otherwise you can also use the command :

waydroid app install <path to apk>

If you don't know where to find the APK you can install Aurora Store to be able to install any Google Play app.

Using a game controller (not tested)

Run the following code:

waydroid prop set persist.waydroid.udev true
waydroid prop set persist.waydroid.uevent true

Make sure to plug in the controller after Waydroid starts. If the controller was plugged in before Waydroid starts, the controller won't be recognized and you'll need to unplug it and plug it back in.

Troubleshooting

No internet

If there's no internet inside Waydroid, then you might want to disable your firewall (or configure it if you're not lazy), and you might want to disable docker and reboot. For some reason the docker service made Waydroid offline on my system.

sudo systemctl disable docker
reboot

The rotation of the thing makes it unusable

I don't know how to solve this issue. Still trying...

It's glitching on tiling window managers

That's because you need to put the window into floating mode in order for it to work properly.

I made some change and now nothing works (how to reset)

sudo systemctl stop waydroid-container
sudo waydroid init -f
sudo systemctl start waydroid-container
sudo rm -rf /var/lib/waydroid ~/.local/share/waydroid ~/.local/share/applications/*aydroid* 

# After that, you can rerun the installation steps starting with "waydroid init"