DEV Community

Alexander Omorokunwa
Alexander Omorokunwa

Posted on • Originally published at on

How to Install Anbox in Ubuntu Linux


Anbox is a contained android emulating platform for Linux systems. Simply put Anbox allows you to run android applications natively-ish on Linux systems. In this post I will show you how to install it on Ubuntu Linux systems.

The only way, for now, to get Anbox is through its snap version. So to install Anbox your system need to support snaps. In the demonstration in this post Ubuntu 16 is used; which supports snap packages out-of-the-box. In fact, according to the Anbox Project they “only have packages prepared for Ubuntu in a PPA on Launchpad. ”.

If you don’t know about snaps get an introduction of what snaps are, how to install support for them on your distribution and how to use them.

Install Anbox [STEPS]:

The installation of Anbox consists of two steps.

1. Install necessary kernel modules

In order to support the mandatory kernel subsystems ashmem and binder for the Android container you have to install two DKMS based kernel modules. The source for the kernel modules is maintained by the Anbox project here.

In order to add the PPA to your Ubuntu system please run the following commands:

$ sudo add-apt-repository ppa:morphis/anbox-support
$ sudo apt update
$ sudo apt install anbox-modules-dkms
Enter fullscreen mode Exit fullscreen mode

These will add the PPA to your system and install the anbox-modules-dkms package which contains the ashmem and binder kernel modules. They will be automatically rebuild everytime the kernel packages on your system update. After you installed the anbox-modules-dkms package you have to manually load the kernel modules. The next time your

system starts they will be automatically loaded.

$ sudo modprobe ashmem_linux
$ sudo modprobe binder_linux
Enter fullscreen mode Exit fullscreen mode

Now you should have two new nodes in your systems /dev directory:

$ ls -l /dev/{ashmem,binder}
Enter fullscreen mode Exit fullscreen mode



2. Install the Anbox snap:

The second step will install the Anbox snap from the store and will give you everything you need to run the full Anbox experience.

Doing this is very simple enter the following command:

$ snap install --devmode --beta anbox
Enter fullscreen mode Exit fullscreen mode

If you haven’t logged into the Ubuntu Store yet, the snap command will ask you to use sudo snap … in order to install the snap:

$ sudo snap install --devmode --beta anbox
Enter fullscreen mode Exit fullscreen mode

The –devmode is required because the Anbox snap is not yet fully confined. Accord to the the project: “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.”

If you want to update to a newer version you can run:

$ snap refresh --beta --devmode anbox
Enter fullscreen mode Exit fullscreen mode

Information about the currently available versions of the snap is available via:

$ snap info anbox
Enter fullscreen mode Exit fullscreen mode

When You want to Uninstall Anbox

If you want to remove Anbox from your system you first have to remove the snap:

NOTE: By removing the snap you remove all data you stored within the snap from your system. There is no way to bring it back.

$ snap remove anbox
Enter fullscreen mode Exit fullscreen mode

Once the snap is removed you have to remove the installed kernel modules as well:

$ sudo apt install ppa-purge
$ sudo ppa-purge ppa:morphis/anbox-support
Enter fullscreen mode Exit fullscreen mode

After which Anbox would have been removed from your system.

You head to your Ubuntu dash an type in “anbox” and then click on the “” with the android logo to launch it. The default apps available include: Contact, Gallery, Files, Email Music, Calculator, Clock, Settings and Email.

anbox default apps

Happy Linux’NG!

The post How to Install Anbox in Ubuntu Linux appeared first on Foss Naija.

Top comments (0)