A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu

Installing Android in VirtualBox

There is a really interesting project named Android-x86 that ports android to 32-bit computers, and some people have successfully dual-booted Android and Ubuntu, but we will just install Android on VirtualBox, as installing it on a host machine is less certain to work.

First, you will need to install VirtualBox (if you haven’t already):

sudo apt-get install virtualbox

Then download Android x86 2.2 EEEPC edition (I found that the EEEPC edition was the only one that worked well on VirtualBox), and create a new virtual machine on virtualbox with these settings (settings that are not listed here are up to you to decide):

Operating System: Linux
Version: Other Linux
Base Memory Size: 256MB is minimum, but 512MB-1024MB is recommended (as Android is already slow on virtualbox, you don't want a RAM bottleneck)

Now select the newly created VM and press CTRL+S. The settings dialog should appear. Select “Storage”->”IDE Controller”->”Add CD/DVD Device” (looks like a CD with a plus icon), and select the Android ISO you downloaded earlier. This is the only required step in the settings, but feel free to check out the other settings.

Now that you have your VM all set-up, start it and immediately press F12, and once the menu pops up, press C. A nice GRUB menu should pop up presenting you with several options, so select the Install option and press ENTER. You will then see a nice dialog-style menu (probably is dialog), giving you the option of creating/modifying partitions or to detect devices. Since there is nothing to detect, just select create/modify partitions.

Select New, and then select Primary. It will then ask you to select the size of the partition (defaulting to the size of the virtual hard disk). I recommend saving at least 512MB for user data. After you’re done with that, select Bootable and then select Write. Type “yes” (without quotes) so that it will actually write it, and then select Quit.

You should now see the old dialog-style menu, but this time there should be an extra partition, so select it (if it is not already so). It will then ask you what you want to format it to, so select ext3 (don’t see why anyone would choose otherwise). Then select Yes when it asks you if you want to install GRUB, and No when it asks you if you want /system to be read/write (unless you develop android or if you want to root it).

Great! Android is now installed! I recommend creating a fake SD card so you can store user data (option available on the last screen of the installation). Now reboot the VM and press F12 and then 1 (so that the hard disk will load first). After that, you can safely unmount the image :).

Now that Android is installed, here are a few tips that I found useful when starting to use it.

  • Disable mouse integration so that you can interact with android with your mouse (you can unlock your mouse by pressing right-control)
  • Right click to go back
  • Super/Windows to go home
  • Menu to see the menu (menu key is at the left side of your keyboard, between ALT or Super and Control)
  • I recommend using Rotation Locker to force all apps to be under portrait (unless you have Weston or a similar window manager that allows you to rotate your windows)
  • NEVER kill virtualbox unless you absolutely have to. If you do so, not only can screw up your android installation, but all the RAM that android used will still be used in your host system (so it’s pretty much like as if you never closed virtualbox). You will reboot to free it.

14 responses to “Installing Android in VirtualBox

  1. Bence Barabas October 25, 2012 at 1:29 pm

    I can’t install it. When I install the Android, and select “Create/Modify partitions”, it says: “FATAL ERROR: Cannot open disk drive.” What do I wrongly?

    • Anonymous Meerkat October 25, 2012 at 5:07 pm

      Did you actually make a virtual harddisk? Check on Settings->Storage->IDE Controllers. If you only see the android image, you will have to create a new VHD (virtual hard disk).

  2. Pingback: How to speed up the Android Emulator by up to 400% « i-techno

  3. android tutorial for beginners December 10, 2012 at 12:21 pm

    i cannt create virtual hard disk….that says fatal error..please let me know what i did..

    • Anonymous Meerkat December 10, 2012 at 5:18 pm

      Same error that Bence Barbaras ( had? What version of virtualbox do you have?

  4. Josiah January 11, 2013 at 4:56 am

    I am stuck with a root prompt. I have no experience yet with Android, how do I boot the OS?

    • Anonymous Meerkat January 11, 2013 at 4:59 am

      Which step are you? Did you just make the virtual machine and popped the ISO in, or are you done with the tutorial?

    • DrT January 11, 2013 at 6:07 pm

      I think I just pressed enter and the gui opened

  5. DrT January 11, 2013 at 6:11 pm

    I’ve just followed your instructions and everything went fine.
    Kubuntu 12.04

  6. omkar September 12, 2013 at 9:18 am

    It is very slow

  7. aman vema January 30, 2014 at 2:06 pm

    i have installed virtual box on ubuntu and installed android -86 4.3 iso file and android also run fine on my laptop but i am not able to load the android application file on my computer to the virtual machine…………………….please help me how to run android applications in the virtual machine

  8. Achala Madushan March 19, 2014 at 5:34 am

    When I boot the virtual machine, and select install, it reboots again and again after 60 seconds.
    can any one help me plz?

  9. Halra April 24, 2014 at 12:10 pm

    learn good resource here :-)
    will try to installing Android in VirtualBox,
    i’ll download virtualbox first, thank you

  10. zubair August 7, 2014 at 9:51 am

    i have followed your instructions..and successfully installed android 4.3 on Vbox,but i didn’t see the option of “create a fake sd card”
    i thought it was my mistake..i tried 3 more times but it did not appear..what should i do? :-( please help me

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: