Use Android apps in QubesOS

Use Android apps in QubesOS

Here are three suggestions on how to use Android apps in QubesOS. I thought I’d share it here so that maybe some of you can save yourselves the trouble of having to look it all up yourselves. I’m happy to receive feedback and suggestions for improvement :slight_smile:

Waydroid in Ubuntu

Firstly, we click on a standalone VM and install the latest LTS version of Ubuntu in it. After updating this, we install the Waydroid software in the terminal as follows:

sudo apt update
sudp apt full-upgrade -y
sudo apt install -y curl
curl -s https://repo.waydro.id | sudo bash
sudo apt update
sudo apt install -y waydroid

After installation, we start the Waydroid app and select the variant Vanilla as Android Type in the Initialise Waydroid window to install a Google-free system. (If you need GoogleServices later, simply select GAPPS here).

As soon as the installation is complete, we click on Done and start a moderately up-to-date Android with the Waydroid app. In March 2025, not a current Android 15, but at least an Android 11 with security updates from February 2024.

What I particularly like about this solution is that it also works well on relatively weak hardware. The VM in my test had no problems with just a few processor cores and 4 GB of RAM.

In a test in March 2025, the messengers Briar, Conversations, Session, Signal and Threema Libre installed in my Waydroid test qube via F-Droid worked. SimpleX, on the other hand, could not be installed. My attempt to install WhatsApp via Aurora failed because the Aurora store kept crashing. However, if I installed WhatsApp directly via an existing apk, WhatsApp also worked.

BlissOS

BlissOS undoubtedly has advantages, but is much less convenient than the Waydroid version above:

We first download the with FOSS apps version of the latest BlissOS version from here Bliss OS For PC. Then we create a new standalone VM (HVM, no memory balancing, 50GB HDD) and boot it from the ISO.

We then select Installation - Install BlissOS to harddisk. Now we create two primary partitions via Create/Modify partition, dos, the first with 30 GB, the second with 20 GB and write the changes via Write. After the installer restarts, we select the larger first partition and choose ext4 as the format. OTA updates and the Grub bootloader are of course enabled.

If the Qube freezes - simply kill it and restart. In the boot menu, we then always select VM Options, BlissOS - Vbox/VMWare No HW Acceleration. We go to the entry with the mouse and click e, now we add the parameter ‘VIRT_WIFI=1’ in the GRUB bootloader in the first line at the very end. After editing, we close the window with Ctrl + x. Now we can connect to the VirtWifi in the BlissOS VM and set the IP configuration assigned by QubesOS using the pencil at the top right (network mask is 32 here).

The nice thing about BlissOS is that the NeoStore and Aurora are already pre-installed. So you can get started straight away and install the apps you need. WhatsApp was easy to install and use via Aurora. The messengers Briar, SimpleX, Conversations and Signal could be installed and used without any problems via the NeoStore. Threema Libre and Session, on the other hand, could not be used in my test, as they started but were displayed rotated by 90°.

In my test in March 2025, BlissOS 16 was an Android 13 with security updates from Mail 2024. Like Waydroid above, BlissOS was also satisfied with 4GB of RAM and a few processor cores.

Android Studio

To emulate a real Android device much more realistically and use the latest Android versions, you could set up an Ubuntu standalone VM and activate nested virtualisation in it as described below. Then install Android Studio in the VM, e.g. as a flatpak from Flathub. Now you can create new virtual smartphones with the Android Virual Device Manager.

I was able to create and start devices in my test, but they were so slow that they were practically unusable. Presumably this variant only makes sense on devices that have powerful hardware and, above all, a graphics card?

However, I know from other tests that - once you have got it up and running - such virtual Android devices can be used with virtually no significant restrictions.

If anyone does not know how to activate nested virtualisation for a Qube in QubesOS: In a dom0 terminal, first create the path /etc/qubes/templates/libvirt/xen/by-name/ and in this the file ExactNameOfYourQube.xml. We now write the following in this file using an editor of our choice:

{% extends 'libvirt/xen.xml' %}
{% block cpu %}
    <cpu mode='host-passthrough'>
        <feature name='vmx' policy='require'/>
    </cpu>
{% endblock %}

Then we start the Qube once so that the file is read in. In dom0 we can then use sudo virsh dumpxml ExactNameOfYourQube | grep vmx to check whether the vmx flag is set. We can do the same within the Qube with cat /proc/cpuinfo | grep vmx.

By the way, if someone does not want to type the xml file: To copypaste from a Qube to dom0: Write the desired content in the Qube into a text file. Then use qvm-run --pass-io ExactNameOfYourQube ‘cat /path/to/file.txt ’. Then you can copy it to dom0 from the terminal.

1 Like

same. If Android Studio can use remote emulators (I couldn’t find how to do this last time I looked - any pointers welcome) and the Waydroid performance is ok, setting up multiple Qubes in a shared network might be a decent option for Android development on Qubes, albeit missing support for newer Android versions.

Small update: If you want to use Waydroid as a template instead of in a standalone VM for better integration, you can find great instructions at: Waydroid template

But let’s assume you have installed it in a standalone Ubuntu qube as I described above. Then you can also shorten a few things in the Ubuntu terminal:

  • waydroid app install /path/to/app.apk installs more apps.
  • waydroid upgrade renews the Android images used.
  • waydroid app list shows the installed apps.

Of course, you can also do all this from Android in Waydroid. But it’s a bit faster in the terminal :wink:

1 Like

As someone kindly pointed out at the last QubesUsersBerlin meeting, it obviously makes no sense to use SimpleX in Qubes on Android. There is also a desktop app from SimpleX with full functionality! I had completely overlooked this because of all the “testing as many messengers as possible from F-Droid”. Tunnel vision 0:-)

Maybe there is a way to run Google’s Android emulator on laptops without a GPU after all. Unfortunately, it will be much more complicated than the variants described above. Here are our notes in case anyone wants to replicate this:

Create Qube

e.g.
Name:
Template: Debian GNU/Linux 12 (bookworm) (official template)
Type: StandaloneVM
Initial Memory: 8192 MB
VCPUs: 4
Include in memory balance: disable
Kernel: provided by qube
Mode: HVM
Devices: Graphics card

→ If you want to use / can use a graphics card it would be a good time to install the corresponding drivers in and tell it to use it for e.g. all processes
→ Android-Emulation also works cpu-only with enough RAM and cores - in another test we assigned 10 VCPUs and 10 GB to the qube - was very slow but worked

Create XML-File

In dom0 create file /etc/qubes/templates/libvirt/xen/by-name/.xml with:

{% extends 'libvirt/xen.xml' %}
{% block cpu %}
    <cpu mode='host-passthrough'>
        <feature name='vmx' policy='require'/>
    </cpu>
{% endblock %}

→ If you have AMD-CPU replace ‘vmx’ with ‘svm’
→ In dom0 check for policy require by
sudo virsh dumpxml | grep vmx
→ In check for vmx flag
cat /proc/cpuinfo | grep vmx

Install Android-Emulator

  • In download cmd-line tools from Download Android Studio & App Tools - Android Developers (seems you have to user a browser - direct links with wget did not work)
  • cd Downloads
  • unzip commandlinetools-linux-_latest.zip
  • mkdir -p ~/.android/sdk/cmdline-tools/latest
  • mkdir ~/.android/sdk/platforms
  • mv cmdline-tools/* ~/.android/sdk/cmdline-tools/latest/
  • Configure execution permissions to your needs for your .android-directory and contents
  • sudo apt install -y adb
  • sudo apt install default-jre-headless
  • sudo apt install default-jdk-headless
  • readlink -f which javac | sed “s:/bin/javac::”
  • export JAVA_HOME=/usr/lib/jvm/java-19-openjdk-amd64
  • echo “export JAVA_HOME=/usr/lib/jvm/java-19-openjdk-amd64” >> ~/.bashrc
  • source ~/.bashrc
  • echo $JAVA_HOME

Setup emulated android device

In
cd ~/.android/sdk/cmdline-tools/latest/bin
→ If you want an android virtual device (AVD) without playstore
./sdkmanager --install emulator platform-tools “system-images;android-35;google_apis;x86_64”
→ Or if you want an AVD with playstore
./sdkmanager --install emulator platform-tools “system-images;android-33;google_apis_playstore;x86_64”

Create avd
./avdmanager create avd --name --package “system-images;android-35;google_apis;x86_64”

Tweak AVD and Qube settings

In adapt the config to your needs e.g.
nano ~/.android/avd/.avd/config.ini

hw.cpu.ncore = 8
hw.gpu.enabled = yes
hw.keyboard = yes
hw.ramSize = 2048M

Start Emulator

To start your avd: ~/.android/sdk/emulator/emulator -avd -no-snapshot &