Sarab

Getting started

Requirements

What your machine needs to run Sarab, and how to check it with one command.

In short

  • Linux on x86_64, with a Wayland desktop.
  • A GPU that Mesa drives: AMD, Intel, or NVIDIA with nouveau. NVIDIA’s proprietary driver does not work.
  • Rust 1.88 or newer, to build Sarab.
  • About 5 GB of disk for Android and its data, and a 1.4 GB download the first time.

Sarab is developed on Arch Linux with Hyprland and tested on Ubuntu 24.04 with GNOME. Other distributions and desktops should work if they meet the requirements below, but have not been tried.

Check your machine

sarab info checks everything below and says what is missing. Every host problem it finds comes with the command that fixes it, for your distribution.

sarab info

Its Host section on a machine that is ready looks like this:

Host
kernel         7.2.6-arch2-1
binderfs       ok
subuid         65536 (ok)
subgid         65536 (ok)
gpu            /dev/dri/renderD128 (amdgpu)
apparmor       user namespaces not restricted
wayland        wayland-1
tools          ok

You do not need to run it before installing: the first sarab start checks the same things before it downloads anything.

The details

Kernel: binder

Android talks to itself through binder, so the kernel needs binderfs (CONFIG_ANDROID_BINDERFS). Arch’s kernel has it built in. Ubuntu ships it as the binder_linux module, which nothing loads by default; Sarab gives you the line that loads it now and at every boot:

sudo modprobe binder_linux && echo binder_linux | sudo tee /etc/modules-load.d/sarab.conf

Both work inside an unprivileged user namespace, which is what makes running Android without root possible.

Sub-ids

Android uses many user ids. Sarab maps them from the range your user owns in /etc/subuid and /etc/subgid. It needs 65536 of each, which is what useradd gives every user by default, so there is usually nothing to do.

GPU

Android draws with Mesa, on your GPU’s render node. That means AMD, Intel, or NVIDIA with nouveau. The image has no software renderer, so without a GPU Mesa drives, Sarab refuses before downloading anything rather than start to a black window. On a machine with several GPUs, SARAB_RENDER_NODE=/dev/dri/renderD129 picks one.

The render node must be open to every user, as systemd upstream, Arch and Fedora ship it. Where it is not (Ubuntu), Sarab prints the udev rule that opens it:

echo 'SUBSYSTEM=="drm", KERNEL=="renderD*", MODE="0666"' | sudo tee /etc/udev/rules.d/70-sarab-render.rules && sudo udevadm control --reload && sudo udevadm trigger -s drm

AppArmor (Ubuntu 23.10 and later)

Ubuntu restricts unprivileged user namespaces with AppArmor. Sarab needs one profile that allows its namespace helper to create Android’s namespaces. packaging/install.sh and sarab info print the line that installs it:

sarab apparmor-profile | sudo tee /etc/apparmor.d/sarab-ns >/dev/null && sudo apparmor_parser -r /etc/apparmor.d/sarab-ns

Host tools

Tool Package
newuidmap shadow, or uidmap on Debian and Ubuntu
systemd-run systemd
ip iproute2, or iproute on Fedora
pasta passt
debugfs e2fsprogs
curl curl
sha256sum coreutils

pasta gives Android its network, as your user and without a bridge. It is the one people most often lack; Sarab will not boot Android without it unless you ask for no network (sarab start --foreground --no-network).

Desktop

A Wayland session, where Android’s windows go. Some of the desktop integration depends on what your desktop offers:

  • Clipboard: the wlr-data-control protocol, which Hyprland, sway and the other wlroots compositors have. Without it Sarab falls back to wl-copy and wl-paste from wl-clipboard, which Ubuntu does not install by default. GNOME has no such protocol, and a shared clipboard there has not been confirmed yet.
  • Notifications: a notification daemon on the session bus.
  • Dark mode: the XDG desktop portal’s colour-scheme setting, which GNOME, KDE and most portal backends publish.
  • Audio: PipeWire’s Pulse server or PulseAudio. Sound from Android apps does not work reliably yet; see Limitations.

    Type to search the documentation.