Anbox: How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way

Anbox Google Play Store Ubuntu

Anbox, or Android in a Box, is a free and open source tool that allows running Android applications on Linux. It works by running the Android runtime environment in an LXC container, recreating the directory structure of Android as a mountable loop image, while using the native Linux kernel to execute applications.

Its key features are security, performance, integration and convergence (scales across different form factors), according to its website.

Using Anbox, each Android application or game is launched in a separate window, just like system applications, and they behave more or less like regular windows, showing up in the launcher, can be tiled, etc.

By default, Anbox doesn't ship with the Google Play Store or support for ARM applications. To install applications you must download each app APK and install it manually using adb. Also, installing ARM applications or games doesn't work by default with Anbox - trying to install ARM apps results in the following error being displayed:

Failed to install PACKAGE.NAME.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

You can set up both Google Play Store and support for ARM applications (through libhoudini) manually for Android in a Box, but it's a quite complicated process. To make it easier to install Google Play Store and Google Play Services on Anbox, and get it to support ARM applications and games (using libhoudini), the folks at geeks-r-us.de (linked article is in German) have created a script that automates these tasks.

Before using this, I'd like to make it clear that not all Android applications and games work in Anbox, even after integrating libhoudini for ARM support. Some Android applications and games may not show up in the Google Play Store at all, while others may be available for installation but will not work. Also, some features may not be available in some applications.

Install Google Play Store and enable ARM applications / games support on Anbox (Android in a Box)


These instructions will obviously not work if Anbox is not already installed on your Linux desktop. If you haven't already, install Anbox by following the installation instructions found here. Also, make sure you run anbox.appmgr at least once after installing Anbox and before using this script, to avoid running into issues. Also, make sure Anbox is not running when executing the script below (I suspect this is what causes this issue mentioned in the comments).

1. Install the required dependencies (wget, lzip, unzip and squashfs-tools).

In Debian, Ubuntu or Linux Mint, use this command to install the required dependencies:

sudo apt install wget lzip unzip squashfs-tools

2. Download and run the script that automatically downloads and installs Google Play Store (and Google Play Services) and libhoudini (for ARM apps / games support) on your Android in a Box installation.

Warning: never run a script you didn't write without knowing what it does. Before running this script, check out its code

To download the script, make it executable and run it on your Linux desktop, use these commands in a terminal:

wget https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh
chmod +x install-playstore.sh
sudo ./install-playstore.sh

3. To get Google Play Store to work in Anbox, you need to enable all the permissions for both Google Play Store and Google Play Services

To do this, run Anbox:

anbox.appmgr

Then go to Settings > Apps > Google Play Services > Permissions and enable all available permissions. Do the same for Google Play Store!

Anbox Google Play permissions

You should now be able to login using a Google account into Google Play Store.

Without enabling all permissions for Google Play Store and Google Play Services, you may encounter an issue when trying to login to your Google account, with the following error message: "Couldn't sign in. There was a problem communicating with Google servers. Try again later", as you can see in this screenshot:

Anbox There was a problem communicating with Google servers

After logging in, you can disable some of the Google Play Store / Google Play Services permissions.

If you're encountering some connectivity issues when logging in to your Google account on Anbox, make sure the anbox-bride.sh is running:

  • to start it:
sudo /snap/anbox/current/bin/anbox-bridge.sh start

  • to restart it:
sudo /snap/anbox/current/bin/anbox-bridge.sh restart

You may also need to install the dnsmasq package if you continue to have connectivity issues with Anbox, according to this user. But this wasn't required on my Ubuntu 18.04 desktop.

48 comments:

  1. Hi there, on this step:
    sudo ./install-playstore.sh
    we have a problem with the script on Linux Mint 19.
    It corresponds to this:
    # get image from anbox
    cp /snap/anbox/current/android.img .
    $SUDO $UNSQUASHFS android.img

    But there is no such folder / and a file
    sudo ./install-playstore.sh
    /home/user/DANE/anbox/anbox-work
    cp: we canot stat on '/snap/anbox/current/android.img': There is no such file or folder

    ReplyDelete
    Replies
    1. Did you install Anbox as a snap? You can find Anbox installation instructions here: https://docs.anbox.io/userguide/install.html. Also, I see that the script had issues with directories containing spaces, which was fixed about 11 hours ago. Re-download the script and see if it works now.

      Delete
    2. If after getting the latest script version it still doesn't work, report a bug here and the developer should be able to help / fix it: https://github.com/geeks-r-us/anbox-playstore-installer/issues

      Delete
  2. Where is the part about libhoudini and enabling arm?? It's not even in the article

    ReplyDelete
    Replies
    1. The script installs Google Play Store as well as libhoudini. It's the same script.

      Delete
    2. From the article: "2. Download and run the script that automatically downloads and installs Google Play Store (and Google Play Services) and libhoudini (for ARM apps / games support) on your Android in a Box installation."

      Delete
    3. Thanks yes you are correct after trying some other options i ran this script again and now some arm apps appear working. Although every time i open play store i get a pure white screen. The only temp fix is to delete all data and cache for play store and i have to do this every time.
      But this causes another problem, even though i'm logged in and it says i bought them, now it tries to get me to rebuy the apps i already own on my play account lol......oh and the settings screen turns white too causing me to have to relogin to fix it.
      It's a good guide but anbox seems so buggy! I can't even download the app i wanted to test anymore since its paid.

      Delete
    4. disregarding the annoying bugs it is working, just one question, is there a crash log i can see for apps that won't load?

      and thank you!

      Delete
    5. nevermind its "adb shell logcat -d"
      i still crashes on many apps so hopefully one day i can fix them

      Delete
  3. Hi! Thank you so much for your carefully written instructions.

    Unfortunately, I ran into a snag at the very end, after entering the lasr command "sudo ./install-playstore.sh"

    After executing the command, at the very end there is an error message: "A dependency job for snap-anbox-92.mount failed. See 'journalctl -xe' for details."

    Checking out "journalctl -xe" gives me this information:

    "Aug 05 15:01:03 kathleen-Lenovo-G50-70 pulseaudio.pulseaudio[1349]: W: [pulseaudio] protocol-native.c: Denied access to client with invalid authentication data." This is repeated numerous times.

    I have no idea what pulsesudio has to do with this! I guess I'm going to try to delete pulseaudio and start over.

    Do you have any other ideas?

    Thanks in advance!
    Kate

    ReplyDelete
    Replies
    1. I had the same problem as the terminal kept repeating

      Job for snap-anbox-92.mount failed.
      See "systemctl status snap-anbox-92.mount" and "journalctl -xe" for details.

      after seeing the log files i deduced that it has trouble unmounting the loop system for anbox
      to solve this i opened nautilus (Files in ubuntu) as root and unmounted the loop system after which the script went on executing the other requests

      hope this helps.

      Delete
    2. I didn't run into this issue and I've ran the script on a few computers. Maybe Anbox is running when you're executing the script?

      Delete
    3. And by the way, thanks for posting a solution to this issue!

      Delete
  4. install-playstore.sh: 行 139: 6696 段错误 (核心已转储) $WGET -q --show-progress $HOUDINI_URL

    ReplyDelete
  5. Script fails with thye following message. Suggestions?
    cp: cannot stat './houdini/houdini': No such file or directory

    ReplyDelete
    Replies
    1. I'm not sure why that happens, I don't encounter any issues with this. After installing anbox-modules-dkms, did you run these commands:

      sudo modprobe ashmem_linux
      sudo modprobe binder_linux

      Also, did you follow the official Anbox installation instructions, installing the snap with "--devmode".

      If you did this and you still encounter issues, you should report them on the script's GitHub repository page: https://github.com/geeks-r-us/anbox-playstore-installer/issues, the script dev may be able to help.

      Delete
  6. I get: lzip is not installed. Please install lzip.
    But when trying to install it it says: Package lzip is not available, but is referred to by another package. (xz-utils, shich is already installed in my system).
    I run Mint 19, any idea?

    ReplyDelete
    Replies
    1. That's weird, Linux Mint 19 is based on Ubuntu 18.04 which has lzip: https://launchpad.net/ubuntu/+source/lzip. It's in the universe repository, maybe you disabled that repo?

      Delete
    2. Super weird, couldn't install it from terminal, but after changing mirror and through synaptic, I could.

      Delete
    3. Managed to go though the installation without errors. But when running anbox.appmgr window opens but nothing happens. Eventually closes and terminal tells me: [daemon.cpp:59@Run] Application manager service is not running yet

      Any idea? Thanks.

      Delete
    4. Did it run before using this script? Because that sounds like an unrelated issue. You could check the installation instructions from here: https://github.com/anbox/anbox/blob/master/docs/install.md to see if you forgot something, like installing the anbox-modules-dkms package, running the modprobe commands, etc.

      Delete
    5. you rock, thank you! It was the modules indeed.

      Delete
  7. $ sudo ./install-playstore.sh
    /home/mirashif/anbox-work
    Parallel unsquashfs: Using 4 processors
    1836 inodes (8401 blocks) to write

    [=============================================================|] 8401/8401 100%

    created 1659 files
    created 280 directories
    created 177 symlinks
    created 0 devices
    created 0 fifos
    ./install-playstore.sh: line 117: cd: ./opengapps/Core/: No such file or directory

    ReplyDelete
    Replies
    1. @Mir Ashif, bello musa, scandal and everyone else having this issue. I took a look at the script and from what I could tell, I think this is happening because wget fails to download this file: https://github.com/opengapps/x86_64/releases/download/20180706/open_gapps-x86_64-7.1-mini-20180706.zip.

      The line which throws the error is 117 which has this command: "cd ./opengapps/Core/". This folder should be created when unzipping the downloaded open_gapps-x86_64-7.1-mini-20180706.zip file but since this file doesn't exist, this folder is never created.

      I guess it could be a proxy / firewall / Internet connection issue. Make sure wget can download files from the command line on your system.

      As a work-around you could try to extract the opengapps archive I linked in this commend in the anbox-work/opengapps/ folder and uncomment the parts about downloading and unpacking it (lines 111 to 114) and see if that works.

      Delete
    2. After further investigating the script, I see that Wget is used multiple times so if that is indeed the issue, the script requires a lot of modifications, so better get wget working on your system. Or maybe it was a temporary GitHub issue that prevented that file from downloading in which case you can just try again and it might work.

      Delete
    3. Just had this issue too. If the download gets interrupted then you can just delete the android.img and open_gapps files from the anbox-work directory in your home folder. This forces the script to re-download and process them from scratch.

      Delete
  8. I am also experiencing the same error: ./install-playstore.sh: line 117: cd: ./opengapps/Core/: No such file or directory

    ReplyDelete
  9. I too have same issue as I am also experiencing the same error: ./install-playstore.sh: line 117: cd: ./opengapps/Core/: No such file or directory

    ReplyDelete
  10. So when i launch Google play store it closes automatically after a few seconds on ubuntu 18.04. But it does successfully open and show me apps.

    ReplyDelete
    Replies
    1. Further investigation seems to reveal that it does not close until the window is clicked in......any ideas?

      Delete
  11. Can you please provide a method to uninstall/revert the script? Many thanks.

    ReplyDelete
    Replies
    1. I'm not aware of a way to revert this other than reinstalling Anbox:

      sudo snap remove anbox
      sudo snap install --devmode --beta anbox

      Delete
  12. Is this script still supported? Attempting to run it hangs/fails due to http://dl.android-x86.org/houdini/7_y/houdini.sfs being unreachable.

    ReplyDelete
  13. hey thank you for this awesome tutorial.
    when i run the script it gets stuck on installing phonesky.apk and seems to be there forever.
    dunno what to do.
    please help. thanks

    ReplyDelete
  14. never mind that i waited long enough and it installed. though the play store doesn't work at all it opens doesn't responds and quits.

    ReplyDelete
    Replies
    1. Enable all permissions for Google Play Store and Play Services.

      Delete
  15. I forked that script to a version that uses Anbox's rootfs overlay feature instead of rewriting the entire SquashFS image, but libhoudini doesn't work at all, no matter what I've tried. ARM based applications don't launch, and instead cause the launching application to lock up until the launch times out.

    ReplyDelete
  16. All worked well but when I go to Settings -> Apps -> Google Play it closes and go back to 'Settings' tab. I did all the steps correctly :(
    I'm almost there omg

    ReplyDelete
  17. I got it all installed.
    But when starting Google Play the Google Play window closes when I try to put the text cursor in search field.
    Need help....
    Regards
    Kjartan

    ReplyDelete
    Replies
    1. I'm having the same issue right now. I'm not sure if it's a bug with the script or Anbox itself, but I see an issue was posted for the script here: https://github.com/geeks-r-us/anbox-playstore-installer/issues/12. Let's hope this is fixed soon.

      Delete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Literally no apps are working unfortunately. Play store works but i can't install wechat, or anything. Nothing is compatible

    ReplyDelete
  20. Did not work on non snap version of anbox

    ReplyDelete
  21. This worked great for me on Ubuntu 18.04.1 snap version in Hyper-V on Windows 10 Pro. Google Play and services are installed. It does seem that AnBox still has a way to go to be able to run more apps. Thanks for the article.

    ReplyDelete
  22. Anyone get pubg to work?

    ReplyDelete
  23. Hi! Can anyone help me plz? When i run the script it show me that :

    /var/snap/anbox/common/rootfs-overlay
    /home/brian/anbox-work
    Parallel unsquashfs: Using 4 processors
    1836 inodes (8401 blocks) to write

    [=============================================================-] 8401/8401 100%

    created 1659 files
    created 280 directories
    created 177 symlinks
    created 0 devices
    created 0 fifos
    (stdin): File ends unexpectedly at member header.
    /bin/tar: Child returned status 2
    /bin/tar: Error is not recoverable: exiting now

    ReplyDelete

Powered by Blogger.