Wednesday, January 7, 2009

Ubuntu 8.10 in Microsoft Virtual PC 2007 SP1

I've been fooling with VPC 2007 SP1 recently and I decided to try loading Ubuntu into a VPC virtual machine. I found this blog that did a great job of explaing how to do it so I gave it a try. Ultimately it worked great! I couldn't believe it. I've played with Ubuntu a little before and always found it very easy to install, but never had much luck installing any Linux in a Microsoft VPC. I had to use the "vga=791 noreplace-paravirt" suggestions mentioned in the comments. The default command line ends with "--" and I didn't know whether to leave those dashes there and place the vga=791 stuff before or after it or delete the "--". I ended up just putting the "vga=791 noreplace-paravirt" at the end, after the two dashes. It booted slowly but ultimately worked.

Friday, January 2, 2009

Convert VMware VMDK to Virtual PC VHD

I had a virtual machine setup using VMware on my Windows XP desktop. This VM was also running Windows XP. So both the host and guest OS was Windows XP. I use it for maintenance of an old system that I didn't want to load and configure on my every-day desktop. I'd been using this VM with the free VMware Server product successfully for a couple years. I always figure that VMware was better than Microsoft's Virtual PC, but I was never really comfortable running VMware Server because technically it's not supported on my Windows XP desktop OS, even though it installed and appeared to work.

For various reasons I decided that I wanted to use Microsoft Virtual PC 2007 SP1 instead (also a free product). I didn't want to format and install everything new inside a new VPC VM, so I set out to find a way to convert my VMware VMDK virtual hard disk to a VPC VHD virtual hard disk.

My searches didn't find a magic bullet. I see that VMware has a tool to suck an OS (and possibly even a VHD) directly into a new VMDK. Why doesn't Microsoft have such a tool? They have some kind of Windows Server kit that will do something like this, but it requires extra software and all sorts of stuff to make it happen. Not lightweight at all. I thought maybe I could simply convert a VMDK to a VHD. Even if I could do that, when the OS booted up in VPC it would probably blue screen (BSOD) because all the hardware would look different in VPC compared to VMware. Kind of like taking a Windows XP image and moving it to totally different hardware. I found various long and complicated explanations of how someone might be able to do this conversion. None of these looked easy enough for me to quickly follow. I was feeling a little bit rushed and lazy today and didn't want to jump through hoops to make this happen.

I ran across WinImage. Its a really nice tool. This product is not free; its shareware. One of the many things this product will do is actually convert a VMDK directly to a VHD. Wow! All this searching for tools but nobody mentioned this thing. So here's what I did to do my conversion and it appears to have worked very well:

  1. Make a backup of the original VMware VM (the VMDK file). This process could hose up everything so you want to be sure to have a backup.
  2. Crank up VMware on the original VM. Uninstall the VMware tools and any other tools/apps/deivers you may think won't work in VPC. The only thing I uninstalled was the VMware tools.
  3. Run Sysprep to prepare the system as if it were a new PC you were deploying. Sysprep will clean all the hardware specific settings out of the OS then shut down the VM.
  4. At this point your VMDK looks like an OS on a system that someone like Dell ships out. The next time its started it will go through a mini Windows setup process, establishing all the hardware specific settings, etc.
  5. Run WinImage and convert the VMDK to a VHD.
  6. Install VPC 2007 SP1, create a new VM and point it to this new VHD. Then crank it up.
  7. Windows XP will go through the mini setup process in the new VPC VM environment and when you're done everything works.

I couldn't believe this actually worked as well as it did. It was pretty smooth and didn't require too much effort. Sysprep isn't hard to work with so don't let it scare you. When the VPC VM first booted up the mouse did not work. I had to do everything with the keyboard. Once I installed the VPC Tools it started working and everything is just fine now.

This isn't really a novice process and I didn't explain the steps in enough detail for a beginner to understand. I figure you're probably like me, someone who knows a little about what they're trying to do and looking for a way to convert from VMDK to VHD with minimum effort. So I hope this tip helps you out. Good luck.