Linux - Set up Waydroid with Google Play (GAPPS)
Initial Setup
- Install Waydroid with your preferred package manager, eg. for aptitude:
sudo apt install curl ca-certificates -y
curl -s https://repo.waydro.id | sudo bash
sudo apt install waydroid -y
- Steps for installing for other distros/package managers can be found on the Waydroid website: https://docs.waydro.id/usage/install-on-desktops
- Initialize Waydroid with the GAPPS branch:
sudo waydroid init -s GAPPS
- Note: if you have previously initialized a non-GAPPS branch of Waydroid, you must remove it first with:
sudo rm -r /var/lib/waydroid
sudo rm -r /home/.waydroid
sudo rm -r ~/waydroid
sudo rm -r ~/.share/waydroid
sudo rm -r ~/.local/share/waydroid
- Run Waydroid!
waydroid show-full-ui
Xorg/X11 Additional Steps
If you attempt to run Waydroid on an X11 system, you will receive the following error:
Wayland socket ... doesn't exist; are you running a Wayland compositor?
- Install a Wayland compositor such as Weston:
sudo apt install weston
- Start Weston:
weston
- Once Weston has started, click the terminal icon in the top left of the screen:
- In the terminal that opens within Weston, enter the following to start Waydroid:
waydroid show-full-ui
Activating Google Services
1. Networking
In order to activate Google Services, your Waydroid device must have an internet connection. This should be set up by default, so if you already have a working connection in Waydroid feel free to skip to Step 2.
If your connection was not set up by default, there's likely something on your system conflicting with Waydroid.
- To test your connection, open the Google Play Store app. If it can't connect to the internet, it'll let you know.
- Docker - Docker's iptables rules conflict with Waydroid. To remedy this:
# Remove the conflicting virtual interface.
systemctl stop docker
systemctl restart iptables
ip link delete docker0
# Restart Waydroid.
waydroid sesssion stop
waydroid show-full-ui # X11 users must do this command in Weston.
- UFW - The following firewall rules must be set:
sudo ufw allow 53
sudo ufw allow 67
sudo ufw default allow FORWARD
2. Google Services
- Go to https://www.google.com/android/uncertified/ and sign in with the Google account you wish to register this device with.
- In your host's terminal, enter the following command to retrieve & print the Google Services Framework Android ID:
echo 'ANDROID_RUNTIME_ROOT=/apex/com.android.runtime sqlite3 /data/data/com.google.android.gsf/databases/gservices.db "select * from main where name = \"android_id\";"' | sudo waydroid shell
- Note: this ID will only exist if the Google Play Store has been successfully opened at least once on the device.
- Copy the retrieved number into the URL above & click Register.
- Hop back onto your Waydroid device (
waydroid show-full-ui
) - Open the Settings app.
- Navigate to Apps & Notifications > See all n apps > Google Play services.
- Click into Storage & cache > Clear cache
- Navigate to Apps & Notifications > See all n apps > Google Play Store.
- Click into Storage & cache > Clear cache
We clear these caches to speed up the registration, it should now take less than 5 minutes. You'll know it's successful when Google stops spamming your device with warning notifications.
You should now be able to open the Google Play Store & sign in with your Google account.
If it hasn't registered after 5 minutes, try restarting Waydroid:
waydroid sesssion stop
waydroid show-full-ui # X11 users must do this command in Weston.
More Resources
GitHub - No internet in waydroid
GitHub - Is there any plan to support X11?
Reddit - Pro Tip: Waydroid with Google Play Services