Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Android emulation (Waydroid)

You can run Android inside a microVM via Waydroid. Enabling Waydroid enables graphics support it needs for rendering the Android UI window.

{ ... }:
{
  mariner.cid = 5;
  mariner.waydroid.enable = true;
  mariner.waydroid.systemImage = "GAPPS";
  mariner.ssh.authorizedKeys = [ "ssh-ed25519 AAAA... user@host" ];
}

Storage

Android /data(installed apps, their data, internal storage) is on the user’s $HOME on the persist volume. Increase the persist volume size if you need more storage space inside Android.

Viewing Android UI

Waydroid is running inside the VM and waypipe proxies the UI window to your host.

Guest

On the guest, waydroid-init.service initializes Waydroid and downloads the selected image on the first start. After that waydroid-session-start.service starts Waydroid session inside a waypipe server. Both steps run automatically on boot, so you don’t need to touch anything.

For troubleshooting, check the service logs:

journalctl -u waydroid-init
journalctl -u waydroid-session-start
sudo waydroid log

Host

You need to set mariner.host.graphics.enable to install the waypipe client service. It starts automatically with your graphical session:

systemctl status --user mariner-waypipe-client.service

If your compositor doesn’t manage a systemd graphical session, activate graphical-session.target or start the client manually.

waypipe --vsock -s 6000 client

And then:

ssh vm@<addr> waydroid show-full-ui

Network access on first boot

By default Waydroid downloads the Android system and vendor images on first initialization. After that the images persist on the waydroid volume and waydroid can start offline. You can also manually copy your images to /etc/waydroid-extra/images which will override the downloaded images.

Google Play Services

If you need Google Play store use the GAPPS image variant. You can also install a Google Play services package like LiteGapps using waydroid-helper.

run-waypipe waydroid-helper

For activating Google Play Store you need to certify the waydroid system with a Google Account at https://docs.waydro.id/faq/google-play-certification

Enable ARM64 to X86 translation layer

If you try to install an application that doesn’t publish X86 binaries you’ll get this error: not compatible with your device.

You need to install an ARM64 translation layer using waydroid-helper and clear Play store data. Install libhoudini for Intel machines or libndk for AMD. Installing both will crash Waydroid at boot.

Known limitations

  • No audio: Audio is not configured yet
  • Blank window flashes: When the Waydroid session is starting you might see blank windows opening for a split second, mostly a cosmetic issue.
  • Turning off or Restarting Waydroid doesn’t restart the session. you need to manually restart waydroid-session-start.service
  • Android network is not reachable from LAN/host.
  • Manual images directory is not persisted on the waydroid volume yet.