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
sudo apt install dkmsInstall Kernel Headers
# Check kernel versionuname -r
# Search for appropriate kernel headerapt search linux-headers-$(uname -r)
# Check if its already installedls -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
git clone --depth=1 https://github.com/anbox/anbox-modules.gitThen run INSTALL.sh script inside the repository.
Can Also do This Manually
First, install Anbox configuration files:
sudo cp anbox.conf /etc/modules-load.d/sudo cp 99-anbox.rules /lib/udev/rules.d/Copy module sources:
sudo cp -rT ashmem /usr/src/anbox-ashmem-1sudo cp -rT binder /usr/src/anbox-binder-1Install modules using DKMS:
sudo dkms install anbox-ashmem/1sudo dkms install anbox-binder/1Enable the necessary kernel modules:
sudo modprobe ashmem_linuxsudo modprobe binder_linuxFinally, verify if kernel modules are installed properly by running the following commands and checking their results:
lsmod | grep -e ashmem_linux -e binder_linux## Expected resultbinder_linux 114688 0ashmem_linux 16384 0
ls -1 /dev/{ashmem,binder}## Expected result/dev/ashmem/dev/binder
ls -alh /dev/binder /dev/ashmem## Expected Resultcrw-rw-rw- 1 root root 10, 55 Jun 19 16:30 /dev/ashmemcrw-rw-rw- 1 root root 511, 0 Jun 19 16:30 /dev/binderYou have successfully installed the required kernel modules if you see the above results.
Installing and Setting Up Anbox
sudo apt updatesudo apt install anbox
## Using snapsudo snap install --devmode --beta anboxAnbox 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.
wget https://build.anbox.io/android-images/2018/07/19/android_amd64.img
sudo mv android_amd64.img /var/lib/anbox/android.imgRestart the service
sudo service anbox-container-manager restartFinally, launch anbox with following command.
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivitySince Play Store and Google Play Services are not available, install applications using adb using the command
adb install your_desired_application.apkIf ADB is not installed in your system, you can install it with:
sudo apt install android-tools-adb