Development Docker Linux Random

Android on Linux

ANDROID IN A BOX is here to bring any Android OS to your Linux box.

Android in a box (Anbox) is a brand new player to the scene making use of containers instead of emulators to bring Android to Linux. Here’s a quick video of it in action.

To get started with Anbox your system needs to first use snaps. There official statement on other distro methods is “We do not officially support any other distribution method of Anbox at the moment but there are community made packages for various distributions (e.g. Arch Linux).” These community packages are not listed on their site but they do have an irc and Telegram channel.

The installation of Anbox consists of two steps.

  1. Install necessary kernel modules
  2. Install the Anbox snap

The kernel modules needed are only available for Ubuntu in a PPA on Launchpad. Community involvement is encouraged to bring Anbox to your favorite distro!

Starting with Ubuntu 19.04 binder and ashmem are now build with the standard Ubuntu kernel (>= 5.0) and you don’t have to install the modules from the PPA anymore.

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 linux-headers-generic anbox-modules-dkms

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 every time 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

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

<code>$ ls -1 /dev/{ashmem,binder}

More detailed info on the kernel modules can be found on the Anbox kernal module install page.

Installing the Ambox snap

$ snap install --devmode --beta anbox

or if not currently logged into the ubuntu store

$ sudo snap install --devmode --beta anbox

–devmode is required as the Anbox snap is not yet fully confined.

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

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

$ snap info anbox

Uninstall information can also be found on their install page.

Install applications

Installation applications into the Android container provided by Anbox we currently use the sideloading functionality Android provides. For this you need to have the Android Debug Bridge (ADB) installed on your host system.

If you’re running Ubuntu or Fedora you can install ADB easily:

# On Ubuntu
$ sudo apt install android-tools-adb

# On Fedora
$ sudo dnf install android-tools

Anbox does not provide any functionality to retrieve Android applications. There are sites such as APKMirror or APKPure that provide links for popular applications and games. Once you have the APK package for the application you can install it into the Android container with the following command:

$ adb install my-app.apk

If the Anbox container is not running yet you can start it with loading the application manager application:

$ anbox.appmgr

Anbox looks very promising and more information on install and configuration can be found on their doc site.

Leave a Reply

Your email address will not be published. Required fields are marked *