{"id":35200,"date":"2021-10-21T16:18:23","date_gmt":"2021-10-21T16:18:23","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=35200"},"modified":"2023-12-10T13:56:13","modified_gmt":"2023-12-10T13:56:13","slug":"anbox-run-android-apps-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/10\/anbox-run-android-apps-ubuntu\/","title":{"rendered":"How to Install Anbox to Run Android Apps in Ubuntu 20.04, Ubuntu 21.10"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-35201\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/android-icon.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\n<b>ANBOX IS NO LONGER IN ACTIVE DEVELOPMENT! Try the popular <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2023\/12\/waydroid-run-android-apps-ubuntu\/\" rel=\"noopener\" target=\"_blank\">Waydroid<\/a> instead!<\/b><\/p>\n<p>Want to run Android apps in Linux? Here&#8217;s how to do it using the Anbox container in Ubuntu 20.04 and Ubuntu 21.10.<\/p>\n<p><a href=\"https:\/\/anbox.io\/\" target=\"_blank\" rel=\"noopener\">Anbox<\/a>, Anbox in a box, is a free and open-source software that runs the full Android system in a container, abstracts hardware access and integrates core system services into a GNU\/Linux system.<\/p>\n<p>There&#8217;s another solution &#8220;<b>Waydroid<\/b>&#8221; to do the similar things in Linux. It&#8217;s said to have better performance, though it requires Wayland session. For those stick to Xorg, here&#8217;s how to install and use Anbox.<\/p>\n<h3>Load Kernel modules:<\/h3>\n<p>Anbox requires <code>ashmem_linux<\/code> and <code>binder_linux<\/code> kernel modules.<\/p>\n<p>1.) If you have the SecureBoot enabled (check via <code>sudo mokutil --sb-state<\/code> command), open terminal by pressing <b>Ctrl+Alt+T<\/b> on keyboard, and run command to sign the kernel module:<\/p>\n<pre>sudo kmodsign sha512 \/var\/lib\/shim-signed\/mok\/MOK.priv \/var\/lib\/shim-signed\/mok\/MOK.der \/lib\/modules\/`uname -r`\/kernel\/drivers\/staging\/android\/ashmem_linux.ko<\/pre>\n<p>2.) Next load the modules one by one via command:<\/p>\n<pre>sudo modprobe ashmem_linux<\/pre>\n<pre>sudo modprobe binder_linux<\/pre>\n<p>3.) Finally verify the kernel modules via command:<\/p>\n<pre>lsmod | grep -e ashmem_linux -e binder_linux<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/load-anboxmodule.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35204\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/load-anboxmodule.png\" alt=\"\" width=\"600\" height=\"231\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/load-anboxmodule.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/load-anboxmodule-300x116.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Install Anbox:<\/h3>\n<p>The software is available to install via official Snap and classic DEB packages, <b>though I recommend the snap package this time<\/b>. Because, the DEB is not well supported. User needs to manually mount binder, download and load Android image, and troubleshoot other issues. And it ultimately failed to run in my case.<\/p>\n<p>To install Anbox snap, press Ctrl+Alt+T to open terminal, and run command:<\/p>\n<pre>snap install anbox --beta --devmode<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/snap-anbox.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35205\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/snap-anbox.png\" alt=\"\" width=\"600\" height=\"137\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/snap-anbox.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/snap-anbox-300x69.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>After installation, you may try to launch Anbox by searching it from activities overview screen. However, it does not launch in my case <i>until installed the Google Play Store<\/i>. If so, try running the command below in terminal to start it:<\/p>\n<pre>anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity<\/pre>\n<h3>Install Google Play Store:<\/h3>\n<p>Anbox has a few built-in applications except Google Play Store, because Google will only permit certified devices to ship with their applications. Thankfully, there&#8217;s an <a href=\"https:\/\/github.com\/geeks-r-us\/anbox-playstore-installer\" target=\"_blank\" rel=\"noopener\">installer script<\/a> to automatically install it for you.<\/p>\n<p>1.) Firstly, open terminal and run command to install some required libraries:<\/p>\n<pre>sudo apt install wget curl lzip tar unzip squashfs-tools<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/playstore-reuqirelibs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35206\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/playstore-reuqirelibs.png\" alt=\"\" width=\"600\" height=\"328\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/playstore-reuqirelibs.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/playstore-reuqirelibs-300x164.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2.) Next, download the script via wget command:<\/p>\n<pre>wget https:\/\/raw.githubusercontent.com\/geeks-r-us\/anbox-playstore-installer\/master\/install-playstore.sh<\/pre>\n<p>3.) Add executable permission:<\/p>\n<pre>chmod u+x install-playstore.sh<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/download-playstore-script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35207\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/download-playstore-script.png\" alt=\"\" width=\"599\" height=\"328\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/download-playstore-script.png 599w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/download-playstore-script-300x164.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><\/p>\n<p>4.) And run the script will download the package and install Play Store:<\/p>\n<pre>.\/install-playstore.sh<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/install-playstore.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35208\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/install-playstore.png\" alt=\"\" width=\"600\" height=\"231\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/install-playstore.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/install-playstore-300x116.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Now, search for and open Anbox from activities overview screen. When it opens, go to settings and <i>grant all permissions to Google Play Store<\/i>, and finally open the Play Store to install Android apps.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-35210\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr-600x325.webp\" alt=\"\" width=\"600\" height=\"325\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr-600x325.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr-300x162.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr-768x416.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/10\/anbox-mgr.webp 1051w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>How to Remove Anbox:<\/h3>\n<p>To remove the software, simply run command in terminal:<\/p>\n<pre>snap remove --purge anbox<\/pre>\n<p>You may also remove the &#8220;anbox&#8221; and &#8220;anbox-work&#8221; folders in user&#8217;s home directory.<\/p>","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; ANBOX IS NO LONGER IN ACTIVE DEVELOPMENT! Try the popular Waydroid instead! Want to run Android apps in Linux? Here&#8217;s how to do it using the Anbox container in Ubuntu 20.04 and Ubuntu 21.10. Anbox, Anbox in a box, is a free and open-source software that runs the full Android system in a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":35201,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2051],"class_list":["post-35200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-android"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/35200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=35200"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/35200\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/35201"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=35200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=35200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=35200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}