Running the Mono VMWare image in VirtualPC
A lot of people love VMWare, but it bugs me. I think the main reason is that it installs with a bunch of Windows services that run automatically, every second my computer is running, whether or not I use VMWare. Since I don't use virtual machines every day, that's annoying. So, after running the free VMWare Player for a few times times, I banished it from my computer.
The Mono team publishes a VMWare image which makes it really easy to check out Mono on Linux without installing or building anything. If you're happy with VMWare, you can grab their free player and run the image. If, like me, you'd rather run this on Virtual PC, follow along and I'll show you how.
If you don't use VirtualPC, or if you don't mind having several virtual machine hosts on your computer, this post obviously isn't for you. Thanks for stopping by, though!
Grabbing the VMWare Image
You can download the Mono VMWare image from the Mono Downloads page. They offer both are http and torrent download options.
Converting the Virtual Hard Disk image
I use Vmdk2Vhd from vmToolkit to convert the hard disk images. It's free, although there's an annoying registration step (which you can probably bypass with BugMeNot). The interface is really simple - browse for the vmdk file, enter the destination filename, and click the "convert" button.
Creating the new VirtualPC Machine
Start up the VirtualPC console and go through the following steps:
- Select "Create A Virtual Machine"
- Set the Operating System to "Other"
- You'll have to decide how much memory you can allocate to the virtual machine; on my workstation with 2GB RAM, I allocated 768MB RAM.
- Select "Use an Existing Virtual Hard Disk" and browse to the location of the VHD file you created earlier using Vmdk2Vhd. I left "Use undo disks" unchecked.
- Hit "Finish" and you should have a new virtual machine shown in your VirtualPC console.
Setting up the Video Driver
VirtualPC and Linux have a long standing feud over video drivers. VirtualPC emulates an S3 Trio video card with 16 bit color depth, while the Linux X Server defaults to 24 bit color depth since that's what a real S3 Trio supports. The result is that Linux video under VirtualPC is always a pain in the neck. So keep with me as we jump through a few hoops to get Linux to recognize VirtualPC's video card.
When you start the virtual machine we created earlier, hit the down arrow to select failsafe defaults and hit enter.
Note: Previous openSUSE images required me to also fix the mouse by adding "i8042.noloop" to the failsafe boot parameters, but this appears to have been fixed for the 1.9 image.
After the boot process completes, you should be looking at a console window. You'll need to log in (root / mono) and enter "sax2 -m 0=fbdev" like so:
SaX2 churns for a bit, then comes up in graphics mode. You can change the configuration, but I just clicked on OK.
At this point, you'll need to reboot. You can do that in the VirtualPC menu (Action / Reset), or you can just type "shutdown -r 0" at the command prompt. When it comes back up, you can boot to Mono 1.9 / openSUSE 1.3 without using the Failsafe options.
We've got one more thing to set up - the network connection is disabled by default. You can connect by clicking on the network icon in the lower right-hand corner, then on "Wired".
Stay tuned - in the next post, we'll make use of this image to take a look at Moonlight, the open source implementation of Silverlight on Linux.