29 April 2009

On Switching a VM from VMWare to VirtualBox

So I recently switched my main tower PC from Debian GNU/Linux to Ubuntu. As part of this move, I decided to move my Windows XP virtual machine (required for work software) from VMWare Player to a VirtualBox instance. I've experimented with a lot of virtualization software, including the above two, Microsoft's Virtual PC, and QEMU, and come to like VirtualBox best, and it's already packaged for Ubuntu 9.

VirtualBox can read VMWare-style virtual hard disks (vmdk files), so the move should have been transparent. Well ... not quite.

It turns out that while VMWare can handle virtual AGP hardware, VirtualBox can't. So when I started the XP session in VirtualBox, it froze. Starting it again in Safe Mode still froze, but told me that the problem was a file called gagp30kx.sys. Google told me that this was a known problem with the current VB, and all I had to do was rename the file to fix the problem.

Except I couldn't boot Windows, so I couldn't rename the file that way. There is a script to mount vmdk files in Linux, but it's only available as part of VMWare Server. I didn't want to spend the time and create a new account at VMWare's web site to install the Server just to run one script, once, then delete it again.

So I had a brainstorm: I downloaded DamnSmallLinux and mounted the ISO file as the virtual machine's CD drive. The VM booted Linux successfully. I mounted the virtual hard disk, located the file, and ... couldn't rename it. It turns out that DSL will only mount NTFS partitions read only.

Brainstorm 2: the Ubuntu install CD is also a LiveCD. I put the CD in my physical CD drive, told VirtualBox to attach that to the virtual session, and rebooted. Now the VM booted into Ubuntu Linux, which
can modify a Windows drive. Renamed the file, rebooted, and there's Windows in VirtualBox. Mission accomplished!

Almost. Turns out I had no network access.

Well, duh, I thought to myself. All the virtualizers have helper apps that you install in the virtual PC to handle networking, mouse control, etc. VMWare calls them "VMWare Tools" and VirtualBox "Guest Additions". Obviously I had to uninstall the VMWare Tools and install the VirtualBox Guest Additions.

You can't. The VMWare Tools won't uninstall unless you run the VM within VMWare. Yes, you can't
remove the VMWare tools without using VMWare itself. Frustrating.

Even worse, the VMWare virtual AMD network driver can't be uninstalled, which means the default network driver for VirtualBox won't install. You can set VirtualBox to use the Intel PRO/1000 series virtual network card, but the driver for that isn't installed by default in Windows XP. And of course, I had no way to get it into the Windows session, because shared drives depend on networking ...

I could have rebooted into Ubuntu using the same trick as above and downloaded the driver that way, but to save time I downloaded the driver in my "real" OS, then used genisoimage to make a tiny CD image of it and mount that on the VM. Once the driver was installed, networking worked flawlessly.

So not a transparent change, but not incredibly difficult. Given the bizarre "use our software to remove our software" policy of VMWare, I'm not likely to switch back from VirtualBox any time soon.


Anonymous said...

I faced the same problem, and had the same frustrations. Why do people keep using VMware?

Carl said...

Oh mysterious one, I think people keep using VMWare because it's the best-known virtualizer, so it's often the first one people try. Then there's inertia keeping them using it.

Anonymous said...

What trouble does it cause to NOT uninstall the VMware tools inside the VM?

Carl said...

Good question, Anonymous. So far, leaving the VMWare Tools installed has caused no problems, aside from preventing my installation of the AMD network driver from VirtualBox's Guest Additions. The VM continues to work flawlessly.

Anonymous said...

For what it's worth I set all the vmware services to disabled and then used a driver uninstall program to remove the vmware drivers. Deleted any file with vmware in it and job done.

FYI you could have just bunged in a Bart PE disk as the VM boot cd. This would have allowed you to delete the drivers from the VM hard disk, and also modded the registry if you needed to.

Blog Archive