Installing Android-x86 on Hyper-V with Windows 8.1 in under 5 minutes
This guide will show one how to install Android-x86 in Hyper-V. We will be using Android 4.3 as our base installation version and using a Windows 8.1 Professional as a host. One great thing about Windows 8 and Windows 8.1 is that Microsoft has enabled a fairly robust version of Hyper-V even it their workstation operating system. The benefit of this is that building development instances is a simple task. In fact, a decently powered workstation or laptop can have multiple virtual machines open at a given time.
Installing Android onto a Hyper-V Virtual Machine
The guide to installing Android on Hyper-V should take only a few minutes to accomplish.
Step 1: Preparing the Hyper-V Host
The first step in getting this to work is to ensure that the host Windows 8 or Windows 8.1 machine has Hyper-V installed. We have a simple Windows 8 and Windows 8.1 Hyper-V guide that works with both versions of the desktop operating system. If Hyper-V is installed either on Windows 8, or a Windows Server/ Hyper-V server, then you are all set and can log into the Hyper-V management console.
One major consideration is which version of Android will you run. For this guide we are going to use an Adroid-x86 build. Further, we decided to use an Android 4.3 version. The reason for this is quite simple, networking in previous versions was very painful because Ethernet did not work out of the box. Android 4.3 changed this and Android 4.4 and newer should also. You can get Android from here: http://www.android-x86.org/download
The next step is quite simple, setting up a new virtual machine. You can simply follow the Linux on Hyper-V guide to set up the VM. The major caveat here is that you do need to utilize the Legacy Ethernet adapter which you can find an example of here. The only major difference is that you will load the Android-x86 iso instead of another operating system.
Total time for this should be about 3 minutes if using the guides and about 90 seconds if you have ever used Hyper-V before. The good news is, it is simple to get the host setup.
Step 2: Installing Android
Luckily, Android has a fairly simple installation method if one has ever used a text based Linux installer. At this point you can continue to use the LiveCD shown here, but that is not optimal since we may want a persistent development instance. For this guide we are going to install the image to a disk so we will pick the “Installation – Install Android-x86 to harddisk” option. One reason for the above screen capture is that the system will go into LiveCD mode if one does not select installation within 60 seconds. There are a few simple click-through screens which are very obvious so we will skip some of them in the interest of download speeds.
Of course to install Android we need a drive to install it on. For this, we will go to Create/Modify partitions.
That brings up perhaps the most non-intuitive part of the installation, cfdisk. For those unfamiliar cfdisk will format the virtual hard drive so that Android can be installed. Here you can see we are using a vhd that is around 4GB in size.
Here is the command sequence to utilize:
Just before hitting quit the screen should look like the below. It may differ based on disk size but that is OK.
Now that we have a proper partition sda1 we can now install it by clicking OK.
Now we will select ext3 for the file system. There are many other options, but ext3 works.
Once that is complete, we will need GRUB as our boot loader. Click yes.
At this point you can either reboot or just run Android-x86. Usually it is easiest to just run but rebooting can be good if you wish to make any minor virtual machine tweaks, such as replacing the network adapter with a legacy adapter if you skipped that part in step 1.
Once Android 4.3 boots, you will see the standard Android setup. There are a few caveats, mainly that you will encounter two error messages. The first is that Bluetooth share has stopped. This is fine since we do not have a Bluetooth device in the virtual machine.
Next, when it comes to selecting Wi-Fi you will get another error message. There is no wireless adapter in the virtual machine so you can click Skip anyway here.
Once setup is complete (you can log into you Google account or create a new one and etc.), you are ready to go!
It should be noted some applications from Google Play do not work on Android-x86 which is a bummer. Hopefully with Intel Bay Trail hitting the tablet scene things will soon change and more applications will have x86 binaries. The major gotcha here is that if the screen goes into power save mode, there is no real way to wake it up. I would strongly suggest raising the sleep limit to at least 30 minutes (which can be done through the Settings UI).
That is it! This should have taken no more than 5 minutes for experienced users and under 10 for newcomers. Microsoft Hyper-V is working very well and this is an interesting alternative to either the development Android emulator or a solution such as Bluestacks.