One of the labs I’m currently working on is connectivity between SCCM 2012 and Exchange 2010, and how SCCM 2012 can manage non-Windows mobile devices running Apple iOS and Android. To this end I need some mobile devices for testing, but I don’t have anything running Android.
Fortunately, it’s possible to get a decent Android test platform up and running within a VM on a Hyper-V host system. Read on to see how it’s done.
To get Android installed within a virtual machine, you need the latest build of the Android-x86 project. This is an Android build which works on x86-compatible systems. It has the disadvantage that it’s not authorised to use the official Android application markets like Google’s Android Market or AppBrain, but there is a small app market attached to the project, and the core functionality is all present and correct.
The latest stable build of Android-x86 is 2.2, and I used the android-x86-2.2-generic build, which is available for download here.
The virtual machine settings are pretty basic, as Hyper-V’s support for Linux is by no means comprehensive. The VM has 512 MB RAM (statically-defined, not Dynamic Memory), a 16GB VHD on the IDE channel and a legacy network adapter:
As for the Linux Integration Components…well, it may be possible to get them working, but not without a significant degree of pain, and this VM already has all the functionality it needs for the purpose.
Next, fire up the VM with the android-x86-2.2-generic.iso mounted. At the start screen, select to install rather than run a Live session:
Next, select to create a new partition:
In the cfdisk utility, select New to create a new partition which takes up the entire hard drive:
Once created, mark the partition as bootable and then select Write:
Quit the utility and you’ll get taken back to the partition select screen – there will now be a new partition to house the Android installation:
Choose ext3 as the filesystem (other options are available if you want the OS to access filesystems shared with other systems):
Once the partition is formatted, select Yes to install the GRUB bootloader:
You can also choose to make the /system directory read/write, but this isn’t recommended unless you’re planning on doing some development/debugging work:
Once the operating system is installed, you can choose to create a fake SD card which is presented to the OS. This is an .img file which can be up to 2GB in size, and resides on the VHD (within the filesystem):
Once completed, the system restarts and boots into the Android OS:
Without the integration tools, the mouse cursor will be captured whenever you click inside the VM window, and performance isn’t blistering. However, the cursor replicates the tap and swipe actions of a finger rather well, and the ESC key or right mouse button gets you back from whichever window you find yourself in.
Clicking in the top right-hand corner of the window enables or disables the context menu. Normally, pulling down the top bar reveals the notification pane, but once the context functionality is enabled, accessing the notification pane instead reveals a context menu down the bottom, and this is used for things like composing new emails within the mail program.
The nice thing with this setup is that it doesn’t need any configuration once it’s installed. The legacy NIC is automatically connected and the system is online. If performance and more seamless functionality is important, then I’d recommend installing Android-x86 on VMware Workstation or Sun VirtualBox as they have more generic (and better) support for Linux, but Hyper-V does a good enough job, and in my situation it has the advantage of being connected to the same virtual network as the SCCM and Exchange servers – and given that this is the functionality I’m keen to test, this is more important than bells and whistles