[How To] Install/Run Waydroid on Xfce (or other non-Wayland desktops)

2023-12-13-02-25

Intro

Waydroid is by far the most performant android emulator on Linux. There’s only one catch: it requires a Wayland session.

While this would seemingly be prohibitive for desktops like Xfce, Mate, Cinnamon, (or KDE or Gnome in an X11 session), there is an incredibly easy way to bypass this limitation and enjoy the blazing fast performance of Waydroid in these non-Wayland desktops.

Note: This has only been tested on Xfce, but it should work on other desktops

Instructions

1. Install Waydroid and your android image of choice
  • As of this post, these are available in the AUR. Use your AUR helper of choice.
  • Note: if you want google apps to be available, use waydroid-image-gapps instead of waydroid-image
pikaur
pikaur -S waydroid waydroid-image
yay
yay -S waydroid waydroid-image
pamac
pamac build waydroid waydroid-image

2. Initialize and start Waydroid/Container

sudo waydroid init
(if using the gapps image, run this instead: sudo waydroid init -s GAPPS)

sudo systemctl enable waydroid-container #only run this if you want the background waydroid service to automatically run at startup
sudo systemctl start waydroid-container

3. Install and launch Weston
  • Weston is a wayland compositor. When launching it from an existing X11 session, it will run “nested” in it’s own window
sudo pacman -S weston
weston

4. Show the Waydroid UI within Weston
  • Resize/maximize the Weston window as desired
  • From within the running Weston window, open Terminal (icon in the top-left), then run:
waydroid show-full-ui

If all went well, you should now have Waydroid running and visible within the Weston window.


5. Closing Waydroid
  • Close Weston window and run:
sudo systemctl stop waydroid-container

6. Starting Waydroid going forward
  • Make sure the background service is running
sudo systemctl start waydroid-container
  • Launch Weston
weston
  • Show Waydroid UI (from Terminal in Weston)
waydroid show-full-ui

Optional

If you installed waydroid-image-gapps, google applications will refuse to run until you add it to your google account. Instructions for doing that can be found here.


Enjoy :slight_smile:

8 Likes

Just make sure the packages are up to date.
As of now:

aur/waydroid-image-gapps 18.1_20231125-1 (+12 1.84) (Out-of-date: 2023-12-03) 

I have yet to run into any restrictions or issues using slightly outdated android images with waydroid.

In addition, updates seem to be fairly frequent (there were 4 updates in the month of November alone), with the last one being only 2 weeks ago.

I would not say this is a point of concern for these packages.

I don’t think it would either - they are images and is run as image.

1 Like

I spent hours searching for “how to open Waydroid in Xfce?” and eventually managed to get it working through solutions I found here and there, running it via Weston. Just as I was celebrating to myself, thinking yes, I finally did it, I came across this topic in the forum. :face_exhaling: I laughed and cried at the same time. :sweat_smile: Thank you for writing this guide; I wish I could have found it earlier so I didn’t waste more than 3+ hours of my time.

1 Like

I had to create an account here to solve that problem (couldn’t upload the image)

https://media.discordapp.net/attachments/1257868554099884043/1257868659745882203/Screenshot_2024-07-03_02-11-39.png?ex=6685f8fa&is=6684a77a&hm=31e33cf41589d65e102dc95a0ee7bb807201eb2ed79dfd56abc2e4ed6369bd82&=&format=webp&quality=lossless&width=847&height=476

Everything seems to be working but the display is messed up
Is there a way to fix it?

I haven’t run into that myself, but looks like there is a known issue with multiple GPUs. More details in the upstream bug report.

If that’s not it, I would open a thread under support for more assistance. Feel free to ping me so I can find it.

1 Like

Everything’s fine

I appreciate your support