Having a one-stop-shop that has most of the products you are looking for saves you a lot of movement, time, and affords you a good feeling of convenience. You know the story. You get to pick and purchase most if not all of what brought you to the shop. It may be far fetched but that example given can be applied to your Linux Operating System. How? You may ask. Well, how about having all of your Android applications in the same lace as your favorite desktop applications? That can be amazing, at least for me.

An opensource tool known as Anbox can make that possibility a reality. Anbox puts the Android operating system into a container, abstracts hardware access, and integrates core system services into a GNU/Linux system. Every Android application will be integrated with your operating system like any other native application.

Anbox uses standard Linux technologies like containers (LXC) to separate the Android operating system from the host. Any Android version is suitable for this approach and it tries to keep up with the latest available version from the Android Open Source Project. Source: Anbox Site

Features of Anbox

  • Open Source: The whole source code is available and licensed under the terms of the Apache and GPLv3 license.
  • No limits: As Anbox is running an entire Android system, conceptually any application can run.
  • Secure: Anbox puts Android apps into a tightly sealed box without direct access to hardware or your data.
  • Performant: Runs Android without hardware virtualization and seamlessly bridges over hardware acceleration features.
  • Integrated: Tightly integrated with the host operating system to offer a rich feature set.
  • Convergent: Anbox scales across different form factors similar like Android does. It works on a laptop and a mobile phone.

Installing Anbox

To install Anbox your system needs to support snaps. To get up to speed with snaps, head over to snapcraft.io to get an introduction of what snaps are, how to install and support for them on your distribution, and how to use them.

In order to get Anbox installed on your system,we are going to follow two steps, viz:

  • Installation of necessary kernel modules (ashmem and binder)
  • Installation of the Anbox snap

In this example, we are going to install Anbox on Ubuntu 20.04 (Focal Fossa) Desktop edition.

Step 1: Update and install essential tools

Once in the terminal of your fresh Ubuntu Desktop, update it and install essential tools we shall use in our installation process

sudo apt update && sudo apt upgrade
sudo apt install android-tools-adb git curl unzip -y

Step 2: Install ashmem and binder Kernel Modules

We need to have dkms and linux-headers on our system installed then we shall proceed to clone the modules from Git and install them. Kindly follow along.

sudo apt install dkms
sudo apt install linux-headers-generic
cd ~
git clone https://github.com/anbox/anbox-modules.git

Install the configuration files:

cd ~/anbox-modules
sudo cp anbox.conf /etc/modules-load.d/
sudo cp 99-anbox.rules /lib/udev/rules.d/

Next, copy the module sources to /usr/src/:

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

Finally use dkms to build and install:

sudo dkms install anbox-ashmem/1
sudo dkms install anbox-binder/1
sudo apt install software-properties-common
sudo add-apt-repository ppa:morphis/anbox-support
sudo apt update
sudo apt install linux-headers-generic anbox-modules-dkms

In order to get Anbox Kernel modules for other distributions, kindly checkout Anbox Kernel Modules GitHub page

The anbox kernel modules are now installed but we do not stop there. Next, we have to manually load the kernel modules, and do not worry, the next time your system starts they will be automatically loaded.

sudo modprobe ashmem_linux
sudo modprobe binder_linux

Confirm that you have two new modules in your systems using either of three ways as follows.

$ lsmod | grep -e ashmem_linux -e binder_linux

## You should see an output like:
binder_linux          110592  0
ashmem_linux           16384  0

$ ls -alh /dev/binder /dev/ashmem

## You should see an output like:
crw------- 1 root root  10, 58 Aug  3 21:43 /dev/ashmem
crw------- 1 root root 511,  0 Aug  3 21:43 /dev/binder

$ ls -1 /dev/{ashmem,binder}

## You should see an output like:
/dev/ashmem
/dev/binder

Step 3: Get anbox installed

In this step, we are going to install the Anbox snap from the store and it will give you everything you need to run the full Anbox experience. Let u get it installed by running the command below:

$ sudo snap install --devmode --beta anbox

Download snap "anbox" (186) from channel "beta"                                                                       35% 1.42MB/s 2m59s

Give the above command some time for it to complete before we start enjoying our Android Apps on Linux.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/08/echo/anbox-in-app-ist-searched.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" height="697" src="data:image/svg xml,” width=”930″>

Anbox starting

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/08/echo/anbox-app-starting-2.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" height="693" src="data:image/svg xml,” width=”924″>

Anbox default apps

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/08/echo/anbox-app-opened-3.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" height="693" src="data:image/svg xml,” width=”924″>

At the moment anbox team requires the use of –devmode as the Anbox snap is not yet fully confined. Work has started with the upstream snapd project to get support for full confinement. As a side effect of using –devmode the snap will not automatically update. In order to update to a newer version you can run:

snap refresh --beta --devmode anbox

Step 4: Install Android Applications on Anbox

Anbox does not come with Google Play Store out of the box. That being said, we have to find alternative ways to get our Apps installed and one way is via Android Debug Bridge(ADB). We need the Android Debug Bridge(ADB) to manually push Android APKs to your virtual Android install in Anbox. We had already installed ADB in Step 1.

Additionally, you may have already guessed that we need another app store to download Android applications. Luckily, there are other stores such as APKMirror. Visit the site in your Ubuntu 20.04 and download an application you need. Also, be sure to choose an x86 APK file. This is because you are emulating Android on a regular 64bit CPU, not ARM.

[email protected]:~/Downloads$ ls
'com.whatsapp_2.20.195.17-204517002_minAPI15(x86)(nodpi)_apkmirror.com.apk'

Start adb because it is usually off by default by executing the command below.

$ adb devices

List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
emulator-5558    attached

Install the Application

adb install com.whatsapp_2.20.195.17-204517002_minAPI15(x86)(nodpi)_apkmirror.com.apk 
Success

Confirm that the app was successfully installed in Anbox.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/08/echo/anbox-app-apk-whatsapp-instaled-5.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" height="687" src="data:image/svg xml,” width=”917″>

Anbox is a growing application and it may not work as perfectly as you may expect. Some applications break while others work okay. Give is a try, talk to Anbox Team on Git and have fun exploring what it has to offer. We appreciate that you stood by and stayed till the end. You can check other articles below.

How To Transfer Everything from Your Old Android to New Android

How to Track an iPhone from an Android Phone

Coolmuster Lab.Fone for Android : Undelete Files on Android – Quick & Safe

Android related learning materials: