Android on Linux, yes, you heard absolute right. The Android is the open source operating system that also based on customized Linux kernel. Albeit it based on Linux but somewhere, the Linux users those are not technically sound may face problems to install android on Linux for running some particular app. If you are a developer then this article is not for you. It for users those are new to Linux and want to install & use the android emulator on Linux.
Installing any third party emulator on Windows is very easy but for Linux, only a few are available for example Genymotion. However, if don’t want a regular emulator then you should go for Anbox-Android in box which is free and opensource virtual emulator for Android that helps the users to install and use Android applications and games directly on Linux PC example Ubuntu, Linux Mint, Kali and more…
The Anbox does not work like other emulators, it actually put the whole Android operating system in a container removes the hardware access and integrate it to your Linux system as the core application. That’s why all Andriod apps you run using Anbox will be integrated with your operating system like any other native application.
Here, in this article, we let you know how to install Anbox on Ubuntu Linux 16.04.
Step 1: Installing the Kernel Modules. For working of Anbox, we need to install two DKMS based kernel module to support the essential kernel subsystem of Android i.e ashmeem and binder. Both DKMS kernel we are going to install are maintained by the Anbox project developers.
Step 2: Installing the DKMS Kernel using the Ubuntu PPA. Follow the below-given commands:
$ sudo add-apt-repository ppa:morphis/anbox-support $ sudo apt update $ sudo apt install linux-headers-generic anbox-modules-dkms
The above command will add the PPA to install the anbox-modules-dkms package.
Step 3: Load anbox-modules-dkms package. After installing the DKMS package, we need to manually call the kernel modules Ashmem and Binder initially. You only need to load them only once to create a directory in /dev after that they automatically loaded whenever you start your system.
$ sudo modprobe ashmem_linux $ sudo modprobe binder_linux
Step 4: Installing the Anbox system via a snap. Currently, the Anbox is only distributed through the Snaps. It is basically third-party containerized software packages system for all major Linux systems without any modifications. At this very moment, the Anbox doesn’t support any other other package distribution method. So, we are going to install the Anbox using Snap.
Note: The Anbox is still in beta stage and might contain some glitches. So, we need to use the devmode to install it with snap without enforcing security policies.
$ sudo snap install --devmode --beta anbox
Step 5: Update Anbox manually. Because of the beta stage, we used the devmode to install the Anbox Snap which has one problem that’s to update it to the latest version you need to run command everytime which is given below to
$ snap refresh --beta --devmode anbox
Step 6: Check the installed Anbox version.
$ snap info anbox
Step 7: Android Debug Bridge (ADB) installation on the host system. To run the Android application in the Android operating system which is provided in the container by the Anbox, we need to install the ADB.
$ sudo apt install android-tools-adb
Step 8: Start the Anbox application manager application: Runt the following command:
Step 9: The Anbox is not like other emulators where you can install the apps directly by retrieving it from some source. You need to download first the apk file from the internet of any particular app which you want to install then after that use the below command to install.
$ adb install my-app.apk
Replace the my-app with the name of the apk file you downloaded. For example, I downloaded the Google Play store apk then I renamed it to Playstore for convenience after that the command for me was adb install playstore.apk. Please see the given screenshot for a clear idea.
Once you install the application it will appear on the front end of the Andbox from where you can use it.
Problems I faced during the Anbox installation:
When I tried to fire the command anbox.appmgr I got the following error:
[ 2018-08-31 19:11:48] [daemon.cpp:[email protected]] Failed to retrieve ready property from application manager
To solve the above error I followed the steps given below:
Run the command in case your version is old…
$ snap refresh --devmode --edge anbox
Enable debug logs:
$ sudo snap set anbox debug.enable=true
Also run the Anbox logs collection utility helps to find any bug information
$ sudo /snap/bin/anbox.collect-bug-info
Now finally run the command:
Now, finally able to solve the above error but now again I stuck at another: ” [2018-08-31 19:23:38] [launch.cpp: [email protected]() ] Session manager failed to become ready”
I ran the following commands and it solved the above issues:
anbox session-manager anbox.android-settings
Note: It may or may not work in your case but in mine, it worked perfectly.
Now I ran the command anbox.appmgr again and this time it successfully able to load the Anbox application manager.
Once it loaded you can also search the Anbox app from the Ubuntu application search.
You might like to know about:
- How to search for files, directories, with certain criteria on Linux terminal
- Tutorial to run Windows 95 app on a Windows, Mac or Linux
- How To Change Ubuntu Root Administrative password, if Forgotten
- How to install Audacity on Ubuntu Linux using terminal
- 20 Basic Linux commands for beginners with examples and syntax
- Comparison between CentOS, Debian and Ubuntu
- How to install Android apps on PC with MEmu, the Android emulator for Windows
11 Best Open source IoT Platforms To Develop Smart Projects
Install Apache, PHP & MYSQL on Windows 11 | 10 using CMD
15 Best Linux Based OS for Raspberry Pi
10 Best GIT Client Alternatives To Sourcetree for Code Management
What are the Advantages of Using GitHub desktop?
What is the difference between GitHub and Sourcetree?
3 thoughts on “How to install Android emulator Anbox on Ubuntu Linux”
This is indeed great. I was looking for this for long
$ sudo modprobe ashmem_linux
modprobe: ERROR: could not insert ‘ashmem_linux’: Required key not available
How to solve this error?
It seems like EFI_SECURE_BOOT_SIG_ENFORCE kernel config has been enabled.
If you installing it locally for testing, try to disable it and see are you getting the same problem or not.
sudo apt install mokutil
sudo mokutil –disable-validation
After that again run the modprobe command