Waydroid template

root@Waydroid:~# systemctl cat waydroid-firewall.service


ExecStart=/usr/bin/bash -c “if (nft create chain ip qubes waydroid-input) &>/dev/null; then nft add rule ip qubes custom-input jump waydroid-input; fi”
ExecStart=/usr/bin/bash =c “if (nft create chani ip qubes waydroid-forward) &>/dev/null; then nft add rule ip qubes custom-forward jump waydroid-forward; fi”
ExecStart=/usr/sbin/nft add rule ip qubes waydroid-input iifname “waydroid0” meta l4proto {tcp, udp} th dport { 53, 67 } accept
ExecStart=/usr/sbin/nft add rule ip qubes waydroid-forward iifname “waydroid0” oifgroup 1 accept
ExecStart=/usr/sbin/nft add rule ip qubes waydroid-forward oifname “waydroid0” iifgroup 1 accept
ExecStop=/usr/sbin/nft flush chain ip qubes waydroid-input
ExecStop=/usr/sbin/nft flush chain ip qubes waydroid-forward

i see. try to correct now :grinning:


As a new user I ran out of messages to post the other day and just wanted to say thanks.

I feel so stupid right now, i have looked through that file several times :rofl:

You are a true lifesaver, thank you for your assistance :pray:

Have i nice day!

Hi everyone,

On Qubes 4.2 and have the Waydroid template and its child AppVMs running beautifully. Thank you apparatus for the guide!

However, I haven’t been able to get Waydroid-Sway to work when using the in-VM kernel.

After installing and setting up the in-VM kernel (and remembering that dom0 needs the grub2-xen-pvh package to support PVH in-VM kernels), the qubes themselves run and open fine, but Waydroid-Sway itself just gets stuck at the Sway loading window after being launched, never getting past that to the LineageOS boot animation.

Has anyone managed to get Waydroid-Sway + in-VM kernel to work? It works just fine on my current dom0-provided kernel-latest (6.8.6-1.qubes.fc37.x86_64), but Sway (or Waydroid?) itself doesn’t seem to like debian-12-minimal’s in-VM default kernel (6.1.0-20-amd64).

EDIT: After checking logs, it seems it’s more a Waydroid issue. Sway logs during launch are the same between Qubes kernel and in-VM kernel, but the in-VM kernel Waydroid logs show an issue related to lxc mounting vs. successful mounting on Qubes kernel. Will update if I can find the solution.

Reinitialize the Waydroid in template after switching the kernel:

https_proxy= http_proxy= waydroid init -f

It’ll redownload the images but I’m not sure how to fix it without it.

1 Like

That did it!!! Worked like a charm. Didn’t even need to redownload the images!
Thank you! :smiling_face_with_three_hearts:

Words can not describe how I excited I am to find this here. I formerly used Genymotion but fraudsters and increasingly tight restrictions made it unusable. I’ve had a go at Waydroid a couple times on Ubuntu and reminds of configuring X on Linux in the late 1990s. You KNOW it works … but ain’t ever gonna work for YOU.

After a difficult first third of the year that involved moving precipitously and a couple weeks of being functionally blind, this is the best welcome back present I could imagine. I should have my Qubes box in operation this coming week, and it’ll finally get joined by the Pixel 8 /w GrapheneOS I’ve been craving for the last six months.

And not a moment too soon, it’s getting crazy out there.

Firstly, thank you for taking the time to write this excellent guide!

Secondly, do you happen to know how to hide the mouse cursor in sway/waydroid?

I think the mouse pointer is handled by waydroid. I don’t know how to hide/disable it.
You can try to ask at the waydroid telegram/matrix channel:
Waydroid | Android in a Linux container

Does this setup have like a seamless mode for Android apps or does it have to be opened with a whole desktop environment around it?

It’ll be launched in full-screen mode inside sway session with android desktop environment.
There is a multi-windowed mode in Waydroid:

But in our case it’ll just open the Android applications inside the sway desktop window.
Maybe there is a way to use some hack to use the multi-windowed mode in Waydroid and make it open each application in its own sway session but I didn’t look into it.

Oh, that’s unfortunate. Thank you for the info though!

When attempting to download the GAPPS image i receive the following error:

ERROR: Downloaded system image has doesn’t match

I downloaded VANILLA the other day and it worked fine. But also today VANILLA gives same error.

I’ve just tested it and it worked for me.
Maybe the download was interrupted because of a network issue?
Try to download again.

Oh, I tried multiple times haha. At least 10. I also tried again today from scratch in a brand new Qube and the same thing happened. It’s always the same “[Downloading 860.88 MB / 861.38 MB … Validating system image. Error: Download system image hash doesn’t match, expected: 8715fd30c15768…5e8”

I don’t have any VPNs or anything so I am not sure what is going on. I was hoping to check back 24hours later and download again and it resolved but does not seem to be the case unfortunately.

You can download the images manually and try this:

The same thing happened when I tried to download the images via Firefox at the very last kilobyte it failed. I had to manually select a different mirror in Japan and it worked. Then I proceeded to follow the link you gave me to install manually. Thanks you for posting that link!

Thank you for posting this walk through. For the past month I start learning handling Qubes OS. I was really happy to find Waydroid with the hope I am able to run Android applications in Qubes Os.

I just finished the steps and and created the AppVM. Waydroid-Sway is visible in the Apps menu and LineAgeOs does start. It takes approximate 8 minutes to start. First I get an error “SYSTEM UI IS NOT RESPONDING”, with the options “close app” or “wait”. After clicking “wait” the error disappears and I can explore LineOs.

Few problems I have:

  1. I don’t have internet connection (how to troubleshoot this?)

  2. It’s very slow and laggy. Is this normal?
    My specs: Dell Latitude E6430, architecture x86_64. Intel I7-3740QM, integrated graphics hd4000 & NVS4200M, 2.70GHZ. 8GBRAM.

Or should I initiate a older image instead of the most actual one?

I appreciate the help!

Do you have Qubes OS 4.1 or Qubes OS 4.2?
How are you checking that there is no internet connection?
If you go to the Settings → System → Waydroid Updater → press refresh button.
What’s the status for the images that you see there?

Do you have HDD or SSD?

You can increase the number of vCPUs assigned to the Waydroid qube. Since there is no hardware acceleration inside the qubes (your GPU is only used by dom0) and graphics are rendered using CPU then it may help if you give it more CPUs.
Since you have 4 cores then try to assign 4 vCPUs to the Waydroid qube.

I’m running Qubes OS 4.2. I checked it with browser, but also with the Waydroid Updater, both images “unknown”.

Ok I assigned 4 CPUS now and it seems better.