Install Android 8.1 Oreo On Linux To Run Apps & Games

Install Android 8.1 Oreo on Linux To Run Apps & Games

android x86 is a free and an open source project to port the android system made by Google from the ARM architecture to the x86 architecture, which allow users to run the android system on their desktop machines to enjoy all android functionalities + Apps & games.

The android x86 project finished porting the android 8.1 Oreo system to the x86 architecture few weeks ago. In this post, we’ll explain how to install it on your Linux system so that you can use your android apps and games any time you want.

Installing Android x86 8.1 Oreo on Linux

Preparing the Environment

First, let’s download the android x86 8.1 Oreo system image. You can download it from this page, just click on the “View” button under the file.

We are going to use QEMU to run android x86 on our Linux system. QEMU is a very good emulator software, which is also free and open source, and is available in all the major Linux distributions repositories.

To install QEMU on Ubuntu(16.04 & 18.04)/Linux Mint/Debian:

sudo apt-get install qemu qemu-kvm libvirt-bin

If you are on Ubuntu 18.10, you need to install different packages:

sudo apt install qemu qemu-kvm libvirt-daemon-system libvirt-clients

To install QEMU on Fedora:

sudo dnf install qemu qemu-kvm

For other distributions, just search for the qemu and qemu-kvm packages and install them.

After you have installed QEMU, we’ll need to run the following command to create the android.img file, which will be like some sort of an allocated disk space just for the android system. All android files and system will be inside that image file:

qemu-img create -f qcow2 android.img 15G

Here we are saying that we want to allocate a maximum of 15GB for android, but you can change it to any size you want (make sure it’s at least bigger than 5GB).

Now, to start running the android system for the first time, run:

sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mhsabbagh/android-x86_64-8.1-r1.iso

Replace /home/mhsabbagh/android-x86_64-8.1-r1.iso with the path of the file that you downloaded from the android x86 website. For explaination of other options we are using here, you may refer to this article.

After you run the above command, the android system will start:

android 8.1 oreo on linux 1 February 17, 2019

Installing the System

From this window, choose “Advanced options”, which should lead to the following menu, from which you should choose “Auto_installation” as follows:

android 8.1 oreo on linux 3 February 17, 2019

After that, the installer will just tell you about whether you want to continue or not, choose Yes:

android 8.1 oreo on linux 5 February 17, 2019

And the installation will carry on without any further instructions from you:

android 8.1 oreo on linux 7 February 17, 2019

Finally you’ll receive this message, which indicates that you have successfully installed android 8.1:

android 8.1 oreo on linux 9 February 17, 2019

For now, just close the QEMU window completely.

Booting and Using Android 8.1 Oreo

Now that the android system is fully installed in your android.img file, you should use the following QEMU command to start it instead of the previous one:

sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img

Notice that all we did was that we just removed the -cdrom option and its argument. This is to tell QEMU that we no longer want to boot from the ISO file that we downloaded, but from the installed android system.

You should see the android booting menu now:

android 8.1 oreo on linux 11 February 17, 2019

Then you’ll be taken to the first preparation wizard, choose your language and continue:

android 8.1 oreo on linux 13 February 17, 2019

Browse FOSS Post ad-free when you subscribe to Patreon

Buy Some Coffee

From here, choose the “Set up as new” option:

android 8.1 oreo on linux 15 February 17, 2019

Then android will ask you about if you want to login to your current Google account. This step is optional, but important so that you can use the Play Store later:

android 8.1 oreo on linux 17 February 17, 2019

Then you’ll need to accept the terms and conditions:

android 8.1 oreo on linux 19 February 17, 2019

Now you can choose your current timezone:

android 8.1 oreo on linux 21 February 17, 2019

The system will ask you now if you want to enable any data collection features. If I were you, I’d simply turn them all off like that:

android 8.1 oreo on linux 23 February 17, 2019

Finally, you’ll have 2 launcher types to choose from, I recommend that you choose the Launcher3 option and make it the default:

android 8.1 oreo on linux 25 February 17, 2019

Then you’ll see your fully-working android system home screen:

android 8.1 oreo on linux 27 February 17, 2019

From here now, you can do all the tasks you want; You can use the built-in android apps, or you may browse the settings of your system to adjust it however you like. You may change look and feeling of your system, or you can run Chrome for example:

android 8.1 oreo on linux 29 February 17, 2019

You may start installing some apps like WhatsApp and others from the Google Play store for your own use:

android 8.1 oreo on linux 31 February 17, 2019

You can now do whatever you want with your system. Congratulations!

How to Easily Run Android 8.1 Oreo Later

We don’t want to always have to open the terminal window and write that long QEMU command to run the android system, but we want to run it in just 1 click whenever we need that.

To do this, we’ll create a new file under /usr/share/applications called android.desktop with the following command:

sudo nano /usr/share/applications/android.desktop

And paste the following contents inside it (Right click and then paste):

[Desktop Entry]
Name=Android 8.1
Comment=Run Android 8.1 Oreo on Linux using QEMU
Icon=phone
Exec=bash -c 'pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda /home/mhsabbagh/android.img'
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;

Again, you have to replace /home/mhsabbagh/android.img with the path to the local image on your system. Then save the file (Ctrl + X, then press Y, then Enter).

[alert type=”warning” icon-size=”big”]Notice that we needed to use “pkexec” to run QEMU with root privileges because starting from newer versions, accessing to the KVM technology via libvirt is not allowed for normal users; That’s why it will ask you for the root password each time.[/alert]

Now, you’ll see the android icon in the applications menu all the time, you can simply click it any time you want to use android and the QEMU program will start:

android 8.1 oreo on linux 33 February 17, 2019

Conclusion

We showed you how install and run android 8.1 Oreo on your Linux system. From now on, it should be much easier on you to do your android-based tasks without some other software like Blutsticks and similar methods. Here, you have a fully-working and functional android system that you can manipulate however you like, and if anything goes wrong, you can simply nuke the image file and run the installation all over again any time you want.

Have you tried android x86 before? How was your experience with it?

Browse FOSS Post ad-free when you subscribe to Patreon

Buy Some Coffee

Challenge your knowledge, and take a quiz.

Go to FOSS Quiz

Comments are moderated before they are published on FOSS Post to keep discussions civil and prevent spam.

People reacted to this story.
Show comments Hide comments
Comments to: Install Android 8.1 Oreo on Linux To Run Apps & Games
  • February 18, 2019

    Awesome! I’ve been waiting for an easy way to do this for YEARS!

    I’m gonna try with “GNOME Boxes”, which is what I use for testing distro’s

    Thanks!

    Reply
  • February 20, 2019

    [[email protected] home]# ls -l
    total 691400
    -rwxr-xr-x. 1 root root 196848 Feb 19 16:27 android.img
    -r——–. 1 root root 707788800 Feb 19 16:36 android.iso
    drwx——. 15 lmartinez lmartinez 4096 Feb 19 15:59 lmartinez
    [[email protected] home]# qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img android.iso
    No protocol specified

    (qemu-system-x86_64:6260): dbind-WARNING **: 16:38:20.830: Could not open X display
    Could not access KVM kernel module: No such file or directory
    qemu-system-x86_64: failed to initialize KVM: No such file or directory
    [[email protected] home]#

    Reply
  • February 20, 2019

    Why do you have to use sudo? Why do you need root to create/run a virtual machine? Would it work without sudo?

    Reply
    • February 20, 2019

      That’s already answered in the article, please read it carefully. No it wouldn’t work.

      Reply
  • February 20, 2019

    I’m trying to Install Android x86 8.1 Oreo on Linux, and when I’m trying to run QEMU, I’m getting the following error.

    [[email protected] vmware-tools-distrib]# qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/lmartinez/Downloads/android-x86_64-8.1-r1.iso
    No protocol specified

    (qemu-system-x86_64:40611): dbind-WARNING **: 20:17:57.484: Could not open X display
    Could not access KVM kernel module: No such file or directory
    qemu-system-x86_64: failed to initialize KVM: No such file or directory
    [[email protected] vmware-tools-distrib]# qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/lmartinez/Downloads/android-x86_64-8.1-r1.iso

    Please let me know if somebody was able to install it, and what I’m doing wrong.
    Regards.

    Reply
  • February 20, 2019

    Just a heads up, but in Ubuntu 18.10, the libvirt-bin package was dropped in 18.10. It has been split into two packages.

    libvirt-daemon-system

    libvirt-clients

    Reply
  • February 21, 2019

    Wonderful. Installed beautifully. However the command to install ‘qemu’ didnt work for me. I Simply used synaptic to install qemu. Rest of the installation was easy. Just for confirmation – will uninstalling qemu remove android? – i guess it should.

    Reply
    • February 23, 2019

      Removing it won’t remove android. You’ll need to manually remove the android.img file from your home directory. And then you’ll need to remove the /usr/share/applications/android.desktop file too.

      Reply
  • February 22, 2019

    Thank you.
    How to transfer files into this system and use adb with it?

    Thanks

    Reply
    • February 23, 2019

      I don’t know of a way to directly transfer files, but you can send your files to yourself via any email service you are using. Or maybe run something like Dropbox.

      Reply
  • February 23, 2019

    Everything installed just fine. Google Play works. When I try to start any apps that I download from Goole Play is where the problem is.
    They all start and immediately crash.
    Thanks

    Reply
    • February 23, 2019

      I don’t have this issue here.

      What are your hardware resources, and what are the resources that you allocated for the QEMU machine (How much memory and CPU)?

      Reply
      • May 10, 2019

        How exactly do you find your VM name, change the memory, CPU, and video memory?
        I got everything up and running fine, I’ve launched my favorite game but it just hangs up on one of the loading screens. I think it might be due to cpu, memory, and vid memory.
        Is it possible to get OpenGL ES 3.0 ?

        Sorry for all the questions and thanks in advance!

        Reply
        • May 12, 2019

          You simply change the parameters of the QEMU command line:

          sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img

          See the 2048 and 3 numbers? They represent the RAM and number of CPU cores you want to use, so if you want to increase them, you can simply change those numbers:

          sudo qemu-system-x86_64 -m 4096 -boot d -enable-kvm -smp 4 -net nic -net user -hda android.img

          Reply
          • May 13, 2019

            Oh derp! Thank you for responding and pointing this out!

  • March 7, 2019

    How do you get sound to work? Do I have to set a flag on the qemu command?

    Reply
    • March 9, 2019

      This is a known issue with QEMU; You’ll need to do some complicated things with QEMU and your host settings to make the audio work. If you just Google for “Qemu audio not working” you would find a lot of threads.

      Reply
  • July 13, 2019

    I tried this and on trying to boot into Android it wanted to look for and connect to WiFi and could not. Suggestions?

    Reply
    • July 16, 2019

      I selected virtual wifi and it connected through the host PC’s wired network

      Reply
  • July 19, 2019

    Please help:

    sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mamascorpio/android-86_64-8.1-r2.iso
    [sudo] password for mamascorpio:
    Could not access KVM kernel module: No such file or directory
    qemu-system-x86_64: failed to initialize KVM: No such file or directory

    Reply
  • July 25, 2019

    Awesome

    Reply
  • August 2, 2019

    I get to the point where I launch from GRUB, but then I get stuck on a screen that shows large flashing “android” logo.

    Reply
    • November 12, 2019

      I have the same problem. Have you solved it, please.

      Reply
  • August 29, 2019

    Thanks for this tutorial!

    I haven’t tried it yet, but I aim to do so. What I had tried in the past few days, is running Android x86 and boy was it fast.

    Sadly I couldn’t find a way to install mdadm of sorts to have my server-hybrid work as expected. So I installed Ubuntu 18.04 LTS.

    Still I would like to keep android x86 for games or easy access. Which brings me to my question:
    does QEMU use hardware graphics acceleration? I know android x86 itself did so on my Intel iGPU.

    Reply
  • April 14, 2020

    thanks you so much. it’s very helpful.

    Reply
  • May 26, 2020

    Hi, I am Gurumurthy

    installed according to the screen but it is showing this message in terminal

    qemu-system-x86_64: warning: host doesn’t support requested feature: CPUID.80000001H:ECX.svm [bit 2]

    qemu-system-x86_64: warning: host doesn’t support requested feature: CPUID.80000001H:ECX.svm [bit 2]

    qemu-system-x86_64: warning: host doesn’t support requested feature: CPUID.80000001H:ECX.svm [bit 2]

    Reply

Leave a Reply

Recent Comments

Monthly Newsletter


.