Logo
Setting up Anbox on Debian
Overview

Setting up Anbox on Debian

March 24, 2022
2 min read
1 subpost

Anbox - (Android in a box) is an open-source application that allows you to run most Android applications/games on any GNU/Linux Operating System.

Install Required Modules

Anbox requires some kernel modules to be installed on the host machine before you can run it. Below are the steps to install those modules.

Install DKMS

Terminal window
sudo apt install dkms

Install Kernel Headers

Terminal window
# Check kernel version
uname -r
# Search for appropriate kernel header
apt search linux-headers-$(uname -r)
# Check if its already installed
ls -l /usr/src/linux-headers-$(uname -r)
# Install Headers (If not already installed)
sudo apt install linux-headers-$(uname -r)

Clone the Anbox GitHub repository to your system

Terminal window
git clone --depth=1 https://github.com/anbox/anbox-modules.git

Then run INSTALL.sh script inside the repository.

Can Also do This Manually

First, install Anbox configuration files:

Terminal window
sudo cp anbox.conf /etc/modules-load.d/
sudo cp 99-anbox.rules /lib/udev/rules.d/

Copy module sources:

Terminal window
sudo cp -rT ashmem /usr/src/anbox-ashmem-1
sudo cp -rT binder /usr/src/anbox-binder-1

Install modules using DKMS:

Terminal window
sudo dkms install anbox-ashmem/1
sudo dkms install anbox-binder/1

Enable the necessary kernel modules:

Terminal window
sudo modprobe ashmem_linux
sudo modprobe binder_linux

Finally, verify if kernel modules are installed properly by running the following commands and checking their results:

Terminal window
lsmod | grep -e ashmem_linux -e binder_linux
## Expected result
binder_linux 114688 0
ashmem_linux 16384 0
ls -1 /dev/{ashmem,binder}
## Expected result
/dev/ashmem
/dev/binder
ls -alh /dev/binder /dev/ashmem
## Expected Result
crw-rw-rw- 1 root root 10, 55 Jun 19 16:30 /dev/ashmem
crw-rw-rw- 1 root root 511, 0 Jun 19 16:30 /dev/binder

You have successfully installed the required kernel modules if you see the above results.

Installing and Setting Up Anbox

Terminal window
sudo apt update
sudo apt install anbox
## Using snap
sudo snap install --devmode --beta anbox

Anbox expects an android image in the /usr/bin/anbox/android.img directory. Download the image and move the image to the required directory using the following command.

Terminal window
wget https://build.anbox.io/android-images/2018/07/19/android_amd64.img
sudo mv android_amd64.img /var/lib/anbox/android.img

Restart the service

Terminal window
sudo service anbox-container-manager restart

Finally, launch anbox with following command.

Terminal window
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

Since Play Store and Google Play Services are not available, install applications using adb using the command

Terminal window
adb install your_desired_application.apk

If ADB is not installed in your system, you can install it with:

sudo apt install android-tools-adb