Install Android x86 in VMware Fusion

Thanks to the Android x86 project you can run Android as a VM in VMware Fusion. Getting this to work requires a few additional steps that are not exactly obvious. So I figured to write this post.

For this post I used the latest release Android 9.0 r1 which you can download from OSDN with this direct link android-x86_64-9.0-r1.iso

Install Android 9.0 as a VM

In VMware Fusion, from the menu select File -> New.
You will get the following screen:

Select Installation method

Drag your downloaded .iso file onto the designated area and press the Continue button.

Select your .iso file
The create a new virtual machine wizard

As you can see I had installed android earlier. The “New VM” wizard comes with the .iso file you dragged onto it selected and it detected it as “FreeBSD 10 or earlier”. That guest OS type isn’t exactly correct, but it doesn’t matter for getting this to work. Select “Continue”.

Select BIOS
Select “Legacy BIOS”, not UEFI

For the firmware option, it is recommended to stick to the “Legacy BIOS”. Click Continue again.

Finish Wizard mode
Finish Wizard

Customize Virtual Hardware

Here we click on “Customize Settings” and not “Finish” as the defaults need to be tweaked for the VM to run better. When you click “Customize Settings you first get an opportunity to rename your VM to something better.

Customize Change Name
Give the VM a proper name

I figured to call the VM “Android x86_64”, but name it anything you like. Then press Save.

Virtual Machine Settings
Adjust the default VM settings

Here we can change the default VM settings.
Click on “Processors & Memory”

Processors and memory
Change default vCPU’s and RAM

The default was 1 vCPU and 256MB of RAM. That’s really not sufficient, change to 2 vCPU’s and 2GB of RAM. More can be added later if it isn’t enough for your usage. No need to change any of the advanced options.

Click on “Show All” after making the changes.

That brings you back to the settings. Click on the “Display” icon to change the settings there.

Display Settings
Enable 3D and assign more video RAM

Enable 3D and change the shared graphics memory to 1024 MB.

Android Installation Walk through

Click back on “Show All” and close the “Settings” dialog. You can now boot your VM. It should come up with the following screen.

Boot menu
Select “installation” in the boot menu

Select “installation” from the boot menu here as we are going to create it into a VM.

Create Partition
Create a new partition

Partitioning the virtual disk

We are going to create a new “All in one” partition, type “C” to select the “Create/Modify partitions” option. With the arrow keys you can navigate on the options. Press the “Return” key with the “OK” button highlighted like here.

Create GPT or MBR
Create MBR

We are not going to use GPT, but MBR instead. So select “No” like the default and press “Return” once more.

Create New Partition
Create a new partition

Use the “Right Arrow” key to select “New” and press Return.

Create Primary Partition
Create a Primary Partition

The partition wizard wants to know if you want to create a Primary or a Logical Partition. Choose the default (Primary) and press return.
After that it asks how big that partition should be. It will default to the whole disk. Which is correct.

size: 21467.98

Press Return again.

Make bootable
Make partition bootable

We need to make the partition bootable in order to be able to start up. So with “Bootable” selected as above press “return”. The “Boot” flag should show up, just as in the screenshot above.
Arrow right a few times to go to “Write”
Press “return”

Write New partition
Write partition to disk

You are asked if you are sure as it is a potentially data destroying operation. This is a new virtual machine, so yes we are sure. Type “yes” -without typing the parentheses- and press return. As you can see in the above screenshot, the letter “s” fell off the screen. Don’t worry about that.

Select partition
Select new partition

Once we have a partition, we can select it.
Select “OK” and return once more.

Create file system
Create ext4 file system

Our partition needs a file system, select ext4 and continue.

Confirm write ext4
Write out ext4 file system

Yep, format as ext4, Select Yes and continue.

Install a boot loader

Install Grub
Install boot loader

Choose to install the GRUB boot loader.
Select Yes and continue.

Copy the installation files to the VM

Install system as read/write
keep system read only

We do not need system read-write so keep it read only. Select “No” and continue. The installer will copy all the files to your virtual disk and once that completes, the following screen appears.

Android is installed
Android installed

Fix the problems

You can try the “Run Android-x86”, but it won’t work. You’ll get a blinking cursor, so you might just save yourself the trouble of having to press reset in the toolbar and go straight for a “Reboot”.

Grub boot menu options
Grub boot menu options

Android is now installed on your virtual disk. However trying the first options gives you a black screen and all the other “Debug” options give you a screen with text scrolling by that all stops at “USB video class driver”

Boot into LVDS
Booting into debug

Not exactly great.
But it can be fixed.

Adjust boot options

So reset the VM, get back to the “Grub options” screen from above.
Select “debug mode” and press the letter “e”, the on line “kernel” press “e” again to edit.

edit grub kernel line
Edit grub kernel line

At the end of the line add “vga=834 nomodeset xforcevesa” like above. Press return to get back in the previous screen and press “b” to boot with the new changed kernel parameters.

boot into debug
Booted into debug

Let it boot. Android might appear to hang at the end, but if you press “return” then you will get a prompt.

edit grub menu.lst
remount read-write, edit grub menu.lst

Remount the disk as read/write

At the prompt do the following

Now remount the partition so you can make changes:
mount -o remount,rw /mnt
Then edit the default menu file for grub in vi:
vi /mnt/grub/menu.lst

Edit in vi
Edit boot option in vi

Use the cursor keys to navigate to the first line that has “kernel” at the front. Press “Shift+a” to move the cursor behind “/android-9.0-r1” then press space and add:
vga=834 nomodeset xforcevesa
at the end of the line.
Save your changes in vi by pressing the Escape key, the type the letters :wq
which should save your changes to the menu.lst file if all went well.
Reboot the system:
cd /
reboot -f

and the system should reboot into the graphical Android environment.

Android welcome
Android welcome screen

Success

That’s it.
From here it is a matter of following normal Android steps except for the network settings.
For networking select “Virtual WiFi” and it should work OK.

android 9
Android 9 in a VM

All the steps above have been reported to work equally well in Workstation Professional 15.5.1

The following links have helped a lot while I had the initial issues getting this to work:
https://www.itsmdaily.com/install-android-on-vmware-fusion-osx/
and this one (in particular the steps from stack exchange user ajira:
https://android.stackexchange.com/questions/144535/android-x86-marshmallow-not-booting-on-virtualbox-and-vmware-workstation#155950


Now that you are here. Please check out our product “Vimalin“. It has been designed for making your life easier to get good backups of your VMs. We support VM’s running in VMware Fusion, VMware Workstation and VMware Player.

More info at our main page