I wonder if is it possible to run android applications DIRECTLY on a Linux distribution like ubuntu or gentoo? I mean running the apps on linux without the help of virtualbox,simulators like genymotion, on google chroom...

is it possible to compile a linux kernel in such a way to do this? if so, is there any guide to to describe the process step by step?

any help is appriciated


Yes, there is, though right now it's still experimental. It's called Anbox, and it uses kernel features to share the kernel between the distro and the Android system.

Oh, and no need to recompile the kernel at all.

| improve this answer | |

No, it isn't. Even if you were running Linux on an ARM-based system, or only wanted to run apps for Android-x86, so that you didn't need an emulator, you'd still have the problem that the GNU userspace doesn't have the same facilities and libraries that Android has. The Android framework, the standard library used by all Android apps, doesn't exist for GNU/Linux, so the apps would not be able to run. It's nothing to do with compiling the kernel in a particular way.

| improve this answer | |
  • what you said is resonable . but I searched and found some research project such as wiki or someone had claimed, he could compile ubuntu kernel to run android apps [stackoverflow] (stackoverflow.com/questions/26031710/…‎to-run-android-apps) – anil Dec 6 '14 at 12:21
  • He asked the question because he couldn't get it to work, and there are no answers. Your research seems to support my answer. – Dan Hulme Dec 6 '14 at 21:32
  • Has this changed since then? – Pavel Šimerda May 11 '16 at 10:45
  • @PavelŠimerda No, why would it have changed? The GNU and Android userspaces are both completely different. – Dan Hulme May 11 '16 at 11:39

Ubuntu 14.04 and later

Anbox has >=4GB RAM recommended hardware requirements.

The anbox-installer is DEPRECATED.

Please find updated installation instructions for Anbox (64-bit architecture only) at https://github.com/anbox/anbox/blob/master/docs/install.md.

Install necessary kernel modules

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

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

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

ls -1 /dev/{ashmem,binder}

Install the Anbox snap

Installing the Anbox snap is very simple:

snap install --devmode --beta anbox

In order to update Anbox to a newer version you can run:

snap refresh --beta --devmode anbox

Type "anbox" in the Dash and click the Anbox icon to start the Anbox Application Manager. In the Anbox Application Manager you will see a row of application icons. Click on an icon to launch it. The Android application will launch in a new window and you will be able to run it.

Anbox doesn't come with Google Play Store pre-installed and does not even have a package installer, so the only way to install additional applications in Anbox is through an Ubuntu software package named Android Debug Bridge (adb). You have to download the .apk file of the app you want to install, open the terminal, change directories using cd to the directory of the .apk file, and then install the app with a command that looks like this:

adb install /path/to/file.apk  

Downloading an .apk file from a warez website is a miserable security risk, however some applications allow you to download the .apk file from the application's official website, for example WhatsApp Messenger for Android.

Then maybe the app will install or maybe it won't install if the app requires additional dependencies that are not installed in your operating system. For example WhatsApp requires Java as a dependency. I already had Java installed in my Ubuntu, so I tried to install WhatsApp.

adb install WhatsApp.apk  

I got an error message that said error: cannot connect to daemon. I closed Anbox and reopened it. I got another error message that said write: Broken pipe. I closed Anbox and opened it again and got the same error message. Anbox is buggy just like the anbox-installer script says it is. I closed Anbox and reopened it again and finally WhatsApp installed in Anbox.

enter image description here

When you open WhatsApp for the first time it shows you a screen with a message that says:

WhatsApp will send an SMS message to verify your phone number.  
Enter your country code and phone number.  

WhatsApp also asks if you want to give the app permission to access the files on your device which is another security risk in my opinion. I think it's OK to give WhatsApp permission to access the files on my phone, but I don't want to give the app permission to access the files on my computer. Permissions are a matter of fundamental importance in Linux. You should be very careful about giving permissions to an application that it doesn't already have by default, and the telegram-desktop snap package in Ubuntu 16.04 has better support than WhatsApp including Telegram Calls voice calls which are currently available to users around the world.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.