Installing Android 6.0 Marshmallow on Linux may be the quest of many of you if you want to run your favorite applications and games while you are still using Linux operating system. In this tutorial we’ll explain how to do that in a few easy steps.

Android Marshmallow is the latest official release from Google for smartphones working with the Android system, it was released in December 9, 2015, it came with a lot of new features like new design, better navigation and a lot more.

Android x86Β is a project that aims to port the Android system to work on desktop computers, the developers behind this project simply take the original open source Android code and modify it to work on laptops and PCs, it’s a great project actually and they are doing it for free. Recently they have joined the forces with Remix OS to work together on porting Android.

What we will do today is we’ll create a virtual image emulator using QEMUΒ on our Linux system, and then we’ll install the latest Android 6.0 Marshmallow on Linux in order to be able to run our favorite applications and games.

Step 1: PrepareΒ QEMU

Android 6.0 Marshmallow on Linux
Android 6.0 Remix OSΒ on Linux using QEMU

QEMU is a free and open source software emulator for the Linux desktop, it’s just like VirtualBox and VMware, however it doesn’t create you a complete virtual machine; it can be used to create an image file and then emulate the operating system or distribution you want to run it and then install it on the created image file, it’s very simple and easy to use.

You can check our tutorial about installing and configuring QEMU to emulate the operating system we need.

However if you are on a hurry, you can run the following command to install QEMU on Ubuntu:

sudo apt install qemu qemu-kvm libvirt-bin

Or Fedora:

sudo dnf install qemu qemu-kvm

After installing QEMU, we can now create an image file; it’s a special file that will contain all our installed files and data for Android 6.0 after installation, you can relate it to a virtual hard drive.

Use the following command to create a 10GB image file (You can change the size if you want but make sure it’s enough):

qemu-img create -f qcow2 android-marshmallow.img 10G

You will notice that a small file was created in your home folder, it won’t be 10GB in size, but QEMU will set its maximum possible size up to 10GB only, this is to save unnecessary used disk space.

If you don’t like to use QEMU, you can use VirtualBox, it’sΒ a complete virtual machine solution with the GUI included:

sudo apt install virtualbox virtualbox-qt

Step 2: Download Android 6.0 Marshmallow for x86

Now we can go ahead and download the latest stable release of Android 6.0 for the x86 architecture. You can just simplyΒ visit the download pageΒ of the Android x86 project and download whatever release you want.

There are 2 main files here:

  • Android-x86 6.0: This is the vanilla android 6.0 Marshmallow released ported to the x86 and x86_64 architectures.
  • Android-x86 6.0 Remix OS: This is a modified ISO file done by the Remix OS project, it contains some improvements and special customization, but it’s almost double in size.

In this tutorial we’ll useΒ the vanilla Android 6.0 images.

Important: At the time of writing this article, the x86 project released the release candidate 2 version of Android 6.0, It’s not the final version yet, so you have toΒ check the official download page for latest release and then replace the name of the file android-x86_64-6.0-rc2.isoΒ with the file you downloaded.

Step 3: Start Installing Android 6.0 Marshmallow on Linux

– Now after you have downloaded the release you want successfully, we can start running it on QEMU in order to achieve our goal, if your downloaded ISO file was for the 64-bit architecture, run the following command:

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

If it was for the 32-bit architecture, run the following command:

qemu-system-i386 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android-marshmallow.img -cdrom /home/mhsabbagh/android-x86_64-6.0-rc2.iso

Don’t forget to replace /home/mhsabbagh/android-x86_64-6.0-rc2.iso with the path and name of the downloaded ISO image. Also make sure you are in the same folder where android-marshmallow.img is located.

– After you run one of the 2 previous commands, you will see that QEMU window has started:

Android 6.0 Marshmallow on Linux Using QEMU
Android 6.0 Marshmallow on Linux Using QEMU

– If you want for now, you can tryΒ Android 6.0 without installing, just choose the first option and then it will load for you:

Screenshot from 2016-08-15 12-08-25

Screenshot from 2016-08-15 12-10-20

– After you are done exploring, close the QEMU window and run it again and this time, choose the last option to start the setup:

Android 6.0 Marshmallow installation on Linux
Android 6.0 Marshmallow installation on Linux

– Then you will be taken to the following window, choose the first option:

Android 6.0 Marshmallow on Linux

– It will ask you if you want to use GPT or not (MBR), select “No”:

Android 6.0 Marshmallow on Linux

– Now it will transfer you to the cgdisk window in order to modify or create partitions, From this window you will have to create a new partition in order to install Android 6.0 Marshmallow on it:

Android 6.0 Marshmallow on Linux

– Click on the “new” button as you can see in order to create the new partition:

Android 6.0 Marshmallow on Linux

 

– It will ask you if you want your new partition to be primary or logical, choose “primary”:

Android 6.0 Marshmallow on Linux

– Then you can specify the disk size you want for the new hard drive, leave it blank to use maximum and hit Enter:

Android 6.0 Marshmallow on Linux– The new partition will be created, however we have to make it bootable by adding the “bootable” flag to it in order to be able to start it later after the installation, just hit the “Bootable” button using the Enter key to do this:

Android 6.0 Marshmallow on Linux

– You will notice that it was flagged as “boot”Β now:

Android 6.0 Marshmallow on Linux

– Now move using the arrows keys and hit the “write” button to write the changes to disk:

Android 6.0 Marshmallow on Linux

Android 6.0 Marshmallow on Linux

– And then quit, you will be redirected back to this window, choose your new created partition:

Android 6.0 Marshmallow on Linux

– You now have to choose the filesystem type, choose ext4:

Android 6.0 Marshmallow on Linux

– It will ask you for a confirmation, click yes:

Android 6.0 Marshmallow on Linux

– Then it will ask you if you want to install the GRUB bootloader, also select yes:

Android 6.0 Marshmallow on Linux

– But it will ask you also if you want to setup an EFI GRUB bootloader, select “Skip”:

Android 6.0 Marshmallow on Linux

– Finally, it will ask you if you want to install the /system directory with read / write permissions, also choose yes:

Android 6.0 Marshmallow on Linux

– Now wait while the installation is complete:

Android 6.0 Marshmallow on Linux

– After it’s done, you can choose whether to reboot or start using Android, here actually you have to choose none of those options, just close the QEMU window without doing anything, the installation is done completely so far:

Android 6.0 Marshmallow on Linux

Running Android 6.0 Marshmallow on Linux

Now if you want to start using Android 6.0 from the installed system on the image fileΒ using QEMU, you can simply run the same QEMU commands again, just make sure to remove the -cdrom xxxxxx option from its end in order to boot up from the local image file:

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

Or if you downloaded the 32-bit image:

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

You will see the GRUB bootloader waiting for you:

Android 6.0 Marshmallow on Linux

– The first after-installation wizard will start, choose your language and continue:

Android 6.0 Marshmallow on Linux

– It will ask you for choosing a Wi-fi network, we don’t need it since we already have internet using QEMU and the inet interface, so you can just simply click “Skip”:

Android 6.0 Marshmallow on Linux

– Then it will check for some updates:

Android 6.0 Marshmallow on Linux

– It will ask you if you want to copy your data from another device, you can skip this for now:

Android 6.0 Marshmallow on Linux

– Now you will have to enter your Google username and password, actually you can skip this step for now but you won’t be able to use Google services, like Google Play, so entering those data is a good option:

Android 6.0 Marshmallow on LinuxAndroid 6.0 Marshmallow on Linux

– You can also enter your payment information from now if you want, since IΒ am poor, I will skip it myself πŸ™

Android 6.0 Marshmallow on Linux

– Later, you will be yielded to enter the date and timezone:

Android 6.0 Marshmallow on Linux

– And link other accounts and emails if you want:

Android 6.0 Marshmallow on Linux

– You can also choose to download the applications and data from your other devices too:

Android 6.0 Marshmallow on Linux

– Finally, your home screen will start, you can choose whether you want to help the x86 project’s developers or not:

Android 6.0 Marshmallow on Linux

– And Congratulations! You can now start using Android 6.0 Marshmallow on Linux using QEMU to install your favorite apps and games! Feel free to browse around and download whatever programs you may like:

Android 6.0 Marshmallow on Linux
Android 6.0 Marshmallow on Linux Using QEMU
Downloading Slither.io game from the Play Store
Downloading Slither.io game from the Play Store

Step 4: Starting Android 6.0 Later Whenever Needed

If you don’t like using the terminal and the command line interface each time you want to start Android, then you can simply create a .desktop file under /usr/share/applications in order to make it a launchable program from the applications menu. Run the following command to create an android-6.0.desktop file in that directory:

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

And put the following content inside:

[Desktop Entry]
Name=Android 6.0
Comment=Run Android 6.0 Marshmallow on Linux using QEMU
Icon=phone
Exec=qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda /home/mhsabbagh/android-marshmallow.img
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;

Replace the Exec value with the command that fits your situation from the previous QEMU commands and make sure to use the absolute path for the android-marshmallow.img (like /home/test/android-marshmallow.img). SaveΒ the file and exit (on Nano, click Ctrl + X).

Now you can launch Android 6.0 whenever you want from the applications menu:

Screenshot from 2016-08-16 12-09-21

Conclusion

Installing Android 6.0 Marshmallow on Linux is very easy actually, it doesn’t take a lot of time and effort, after you install it, you will able to run whatever games or mobile apps you want easily on your Linux desktop withoutΒ the need to use any other 3rd-party software, thanks to the x86 project.

For further reading, we recommend checking the official documentation.

People reacted to this story.
Show comments Hide comments
Comments to: Install Android 6.0 Marshmallow on Linux to Run Apps & Games
  • August 18, 2016

    Thanks for this tutorial

    I followed each step, but unfortunately the Android OS is so slow and the resolution is bad. Is there anyway to fix this?

    Reply
  • August 19, 2016

    I was wondering if it would be possible to simply access these installs from “Virt-Manager”? After all, it’s just a grapical front end for QEMU/KVM. And I’m referring to AFTER installing it this way via command line, not to do the install process itself. Also do you think these same steps will work for RemixOS? I own a Jide Remix Ultratablet, and I’d actually prefer to use that over vanilla Android 6.

    Reply
    • August 19, 2016

      Yes of course it works, here’s a screenshot from my computer with virt-manager in the attachments. And yes, the installation steps and everything else is the same for RemixOS.

      Reply
  • October 21, 2016

    Nice info. Everything worked. But I am not getting mouse pointer. What will be the issue? Thanks.

    Reply
  • November 12, 2016

    Which do you think is better for Android testing purposes, the method in this article or using an ordinary emulator like genymotion? I mean, How is this different from tools like genmotion? adv, disadv, etc

    Reply
  • January 11, 2017

    This article presents a great approach. But I hope that someone will eventually port, from Chrome OS to traditional GNU/Linux, Google’s Arc++, which is what Google relies on running Android apps on Chromebooks.

    I’ll note that all of the important bits of Google’s Arc++ are open source, and according to a Google dev “there’s nothing stopping people from implementing this approach elsewhere.” That said, there are many interacting components, and I’ve been told that, without more guidance from Google, it’s currently difficult to figure out how they all interact. The Arc++ project is still in beta, and the Google folks are busy rolling out Arc++ to more Chromebooks, so they haven’t (yet) taken the time to provide much guidance. But based on a talk given David Reveman by at XDC2016, Google seems receptive to discussion.

    Reply
  • April 7, 2017

    Nice info. I install Android perfectly it runs good, but when I go out android I need to reinstall. Can you explain me the form for use Android in Ubuntu several times without reinstall every time?

    Thank you, and excuse my English. I only speak Spanish.

    Reply
    • April 9, 2017

      Hello.

      You’ve probably made the mistake of using the same QEMU command to run the installation with the normal bootup. Which is the reason it’s asking you to install it again. Make sure you are not using the “-cdrom /home/mhsabbagh/android-x86_64-6.0-rc2.iso” option or anything related to “-cdrom”. As this will cause it to boot it as a new installation.

      Reply
  • April 16, 2017

    For now, I’m still running Android in a VM using QEMU/KVM.

    But I’m really looking forward to Anbox. Hopefully it will become more usable in the coming months. Can’t wait!

    Reply
  • July 16, 2017

    Somehow all the commands in this article became “sudo nano /usr/share/applications/android-6.0.desktop”
    What happened?

    Reply
    • July 16, 2017

      Thanks for telling us about it! It seems to be a WordPress plugin which we activated (a shortcode plugin). We have disabled the plugin and now everything is back to its original statues.

      Thank you again for taking time to write this.

      Reply
  • December 24, 2017

    And how to deallocate the memory created for that img ?
    Actually i have tried to create windows virtual machine by the about procedure..
    but its not booting.. so i have deleted that img file by rm but i don’t think the memory consumed by that is freed
    So, let me know how it can be done.
    Thanks πŸ™‚

    Reply
    • December 24, 2017

      What do you mean by “deallocate the memory? The memory you chose during setup (like 512MB or 2000MB) is the maximum memory that can be used by the virtual system. It is not “allocated” forever. If your QEMU machine is turned off, then it is not longer be in use. And even if your QEMU machine is on, if your virtual system doesn’t use all of the memory it has (like Maybe XP would use just 500MB out of 2000MB), then the remaining memory would be free for your host system.

      Reply
      • December 25, 2017

        You have given 10gb disk space for Android VM about and I have given 37gb for my windows VM in my pc. Are you saying that if VM is not running this 37gb can also be used to store other data in my actual Linux OS?
        I’m talking about the disk storage not the ram.

        Reply
        • December 25, 2017

          OK so you are talking about the hard disk space, not the memory. But the same applies: The 37GB disk space that you allocated for QEMU is not used directly, but it is the “maximum” space that can be used by QEMU machine.

          So, let’s say you installed a Windows 10 OS on your QEMU machine which took around 15GB of disk space. Then, you would still have the remaining 22GB free for use by your host system.

          It is “use on demand”.

          Reply
          • December 25, 2017

            Thank you πŸ™‚
            And I want to delete that VM…
            Please let me know how that can be done?

          • December 25, 2017

            You simply delete the file and that’s it!

          • December 25, 2017

            Okay
            Thank you ☺️

  • October 28, 2018

    I get this error when I try to install using your method.

    http://mo-de.net/d/aie.png

    Reply
  • December 29, 2018

    HI CAN ANYONE HELP ME I JUST CANNNOT TURN ON THE WIFI .AND I TRYED ON MORE LAPTOPS AND OTHER ANDROID VERSION AND EVRYWHERE IS A SAME PROBLEM NO WIFI .IT SEEMS LIKE THERE IS NO WIFI INSTALED AT ALL.

    Reply
    • December 30, 2018

      Please make sure that you have used the “-net nic -net user” option in the QEMU command. Normally you do not use the Wifi Settings in Android to establish a connection to a Wifi network, but instead, you depend on your already established internet connection in the hosting machine (your computer OS) and allow QEMU to use it in Android (using the options that I gave to you).

      Regards.

      Reply

Write a response

Your email address will not be published. Required fields are marked *

Stay Informed

Keep up with the latest open source matters, away from blogspam, by following our social media accounts.