November 19, 2024 · Linux Guide

Linux - Set up Waydroid with Google Play (GAPPS)

Initial Setup

  1. 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
  1. Initialize Waydroid with the GAPPS branch:
sudo waydroid init -s GAPPS
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
  1. 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?

  1. Install a Wayland compositor such as Weston:
sudo apt install weston
  1. Start Weston:
weston
  1. Once Weston has started, click the terminal icon in the top left of the screen:
    Screenshot_20241119_224207.png
  2. 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.

  1. To test your connection, open the Google Play Store app. If it can't connect to the internet, it'll let you know.
  2. 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.
  1. UFW - The following firewall rules must be set:
sudo ufw allow 53
sudo ufw allow 67
sudo ufw default allow FORWARD

2. Google Services

  1. Go to https://www.google.com/android/uncertified/ and sign in with the Google account you wish to register this device with.
  2. 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
  1. Copy the retrieved number into the URL above & click Register.
  2. Hop back onto your Waydroid device (waydroid show-full-ui)
  3. Open the Settings app.
  4. Navigate to Apps & Notifications > See all n apps > Google Play services.
  5. Click into Storage & cache > Clear cache
    Screenshot_20241119_224207_2.png
  6. Navigate to Apps & Notifications > See all n apps > Google Play Store.
  7. 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

  • LinkedIn
  • Tumblr
  • Reddit
  • Pocket