|Consider using native Linux programs instead, see FAQ.|
Waydroid is the modern approach to run Android apps on Linux. It is similar to Anbox, but it works with Wayland and is more performant. As of writing, Waydroid is available in Alpine Linux and postmarketOS edge, but it is in an experimental stage.
$ sudo apk add waydroid
After installation, the Waydroid session is configured to start automatically on boot.
In order to run apps, the container needs to be started as well. (Apparently it should start automatically when running apps? Also it appears to take quite some time to start up.)
You can start the container and session as follows:
"Container" refers to the Android LXC container itself
$ sudo rc-service waydroid-container start
You can also let the container start on boot automatically:
$ sudo rc-update add waydroid-container default
"Session" refers to the Waydroid specific bits to integrate Android apps into your users environment (.desktop files etc). If it doesn't start up automatically on boot, you can launch it manually (and you have to do this if you stop the previously mentioned OpenRC service):
$ waydroid session start
Use the following command to inspect the status of Waydroid:
$ waydroid status Session: RUNNING Container: RUNNING Vendor type: MAINLINE Session user: user(10000) Wayland display: wayland-0
You can run the Android container in fullscreen (note that this isn't necessary to run apps):
$ waydroid show-full-ui
Run apps from the command-line:
$ waydroid app list $ waydroid app launch com.android.settings
waydroid -h for more information.
The container may not have access to the Internet out of the box. To access the network
you need to allow access from and to the container via the firewall (otherwise DHCP will be blocked and the container will never get the IP) and configure a default gateway in the waydroid container (gateway IP is what your host device has on
$ echo "ip route add default via 192.168.250.1" | sudo waydroid shell
Starting the Waydroid service
If you see something like this in your log:
(004537) [17:13:07] % sudo mount /usr/share/waydroid-extra/images/system.img /var/lib/waydroid/rootfs mount: /var/lib/waydroid/rootfs: mount failed: Operation not permitted.
You most likely don't have the loop kernel module loaded or enabled. Try
modprobe loop. If that doesn't work, make sure CONFIG_BLK_DEV_LOOP is enabled in your kernel.