Installing Anbox

1. Setting up compatible Kernel, Headers, and Modules:

1.1. Installing the Kernel and Headers: Perform one of the below options (Either 1.1.1. or 1.1.2. not both)
1.1.1. Install a patched kernel: Choose a kernel from here: List of Arch Linux Kernels patched for Anbox. For simplicity, this guide talks about the installation of linux-xanmod-anbox. However, you could use any of the kernels from the above link and follow similar steps to install the kernel and the corresponding kernel header.
Caution: We have only tested with linux-xanmod-anbox and linux-zen-anbox kernels. Install the above kernel (along with headers) using
yay -S --needed linux-xanmod-anbox linux-xanmod-anbox-headers
1.1.2 (Not recommended if you have not built a kernel before) Build your kernel with configuration options: Follow How to Build Linux Zen Kernel with Configuration Options for Anbox.
1.2. Boot through the new kernel: This guide assumes that you use Grub as the bootloader (this is the default in RebornOS). Instead of steps 1.2.1. and 1.2.2., you could alternatively use grub-customizer to accomplish the same tasks
1.2.1. Edit the Grub file:
sudo gedit /etc/default/grub

to add the following lines (modify existing lines if they exist):

  2. GRUB_DEFAULT=saved
(Save and exit)

1.2.2 Regenerate grub.cfg:
sudo grub-mkconfig -o /boot/grub/grub.cfg
1.2.3. Reboot and choose the patched kernel that you just installed
1.3. Setting up Kernel Modules:
1.3.1. Enable module loading at boot:
sudo gedit /etc/modules-load.d/anbox.conf

to create anbox.conf and add the below lines:

  1. ashmem_linux
  2. binder_linux
(Save and exit)

1.3.2. Load Modules: (As of 14-March-2021, linux-zen-anbox has the following modules already enabled, and hence this step can be skipped if you chose the linux-zen-anbox kernel.)
sudo modprobe -a binder-linux ashmem-linux
1.3.3. Enable creating mount point of binderfs at boot:
sudo gedit /etc/tmpfiles.d/anbox.conf

and add the following line:

  1. d! /dev/binderfs 0755 root root
(Save and exit)

1.3.4. Mount binderfs:
  1. sudo mkdir -p /dev/binderfs
  2. sudo mount -t binder none /dev/binderfs
1.3.5. Enable mounting binderfs at boot:
sudo gedit /etc/fstab

and edit the file to add the following line:

  1. none /dev/binderfs binder nofail 0 0
(Save and exit)

2. Setting up Anbox:

2.1. Install Anbox:
yay -S anbox-git

(Select one of the options. If you are not sure, you can pick anbox-image-gapps-magisk-xposed)

2.2. Configure Networking:
sudo systemctl enable --now systemd-networkd
2.3. Enable the Container Manager Service:
sudo systemctl enable --now anbox-container-manager.service
2.4. Enable the Session Manager Service:
systemctl --user enable --now anbox-session-manager.service
2.5 Verify modules: Check if the modules are loaded correctly by running the below:
  1. anbox system-info | grep binder -1
  2. anbox system-info | grep ashmem -1