Marshmallow in VirtualBox:installation stuck on GRUB

First, select Create/modify partition:

enter image description here

Then create 2 partitions:

  • Create a small (100m) first primary partition for grub. Set the bootable flag. Write changes.
  • Create an extended (logical) partition for the rest, and install android on the 2nd. Grub will go automatically to the 1st one. Write changes.

Just adding my 2 cents, on what I think is happening:

Actually from a bit of experimentation it's not the presence of 2 partitions that allows Grub to proceed it's the "Create/Modify permissions" that you need to get into first to create a GPT partition table before you can format the partition. (That's why manual partitioning also worked for Dr. Gianluigi Zane Zanettini in the comments of the originally accepted answer).

What actually seems to be happening is that if you don't create the partition table, when you come to the formatting stage where it asks you to format the partition (EXT4, EXT3, etc), the installer seems to say that it's successful, when actually it hasn't happened because the GPT partition table doesn't exist. So when it asks you to install grub it tries to install grub onto an unformatted partition ... and fails silently.

If you go to "Create/Modify Partition" and create a "New" single partition (accept the defaults creating a single partition), "Write" "Quit"; and then go to format the partition after as the next step, Grub will get installed and the installation will proceed as normal.

(Emphasis on the single just to show that even a single partition will work.)

NB: I haven't managed to get the GUI to run for Android x86 (android-x86-6.0_20160129.iso), but at least it seems to boot - meaning it passes through the grub installation and i get a shell prompt.


This worked successfully for me for installing Android x86 4.4-r5 (android-x86-4.4-r5.iso) on VirtualBox 5.2.0:

  1. Create a VM: Select Type as Linux and Version as Linux 2.6 / 3.x / 4.x (32-bit) and click Next
  2. Leave memory the default of 512 MB (or choose more, doesn't matter)
  3. Create a new virtual hard disk. I chose 8 GB
  4. Click Start
  5. In the popup select the iso: android-x86-4.4-r5.iso
  6. In boot menu select Installation - Install Android-x86 to harddisk
  7. In Choose Partition menu select Create/Modify partitions
  8. In Do you want to use GPT question select No
  9. cfdisk program will open
  10. Select New and select Primary as partition type, set size to 100 MB and select Beginning
  11. Select bootable. Now the Flags column should say Boot for the new paritition
  12. Select the free space and select New and select Primary as partition type, leave size as default to fill the remaining free space
  13. Select Write and type yes and press Enter
  14. Select Quit
  15. Now the Choose partition menu should display this configuration:

    sda1 unknown VBOX HARDDISK
    sda2 unknown VBOX HARDDISK
    
  16. Select the second partition: sda2 and select OK
  17. Select ext2
  18. Select Yes in lose data warning popup
  19. Wait for formatting to finish
  20. In Do you want to install boot loader GRUB? question select Yes
  21. In Do you want to install EFI GRUB2? question select Yes
  22. In Do you want to format the boot partition /dev/sda1? select Yes
  23. In Do you want to install /system directory as read-write select Yes (doesn't matter for us)
  24. Wait for installation to finish
  25. In Congratulations! menu select Reboot
  26. Remove the installation iso so it doesn't boot back to installation

I just spent 3 hours trying to get this to work. Hope this helps someone.

Bonus 1:

To set up ADB debugging see http://www.android-x86.org/documents/debug-howto :

  1. Enable Developer options in Android and enable USB Debugging
  2. In VirtualBox go to Devices -> Network -> Network Settings
  3. Make sure Adapter 1 tab is selected and click Advanced
  4. Make sure Cable Connected box is checked
  5. Click Port Forwarding
  6. Click the plus sign
  7. Set the following values: Name: adb, Prodocol: TCP, Host IP: leave blank or set to 127.0.0.1 to make it accessible from localhost only, Host Port: 5555, Guest IP: leave blank, Guest Port: 5555.
  8. Click OK
  9. To connect via ADB:

    # adb connect localhost:5555
    
  10. Now adb devices should show:

    List of devices attached
    localhost:5555  device
    

Bonus 2:

In VirtualBox Input menu unselect the Mouse Integration and now mouse pointer will show up!