This St. Patrick's day I was at a bar with a friend of mine from my old Community College days and we were discussion virtualization software. Yes. I am that nerdy. I was bemoaning my usual complaint that VMWare Server 1.x, which I used in the original article since it supported raw disk access, takes an absurdly long time to start a VM on Windows Server 2008, and also Windows 7 (presumably Windows Vista as well). This startup time is on the order of 6-8 minutes during which the entire system is hung and unusable. He was curious why I didn't use something like VirtualBox. I had been under the impression that VirtualBox didn't do this since it wasn't in the GUI or listed as a feature. However, I was wrong.
My enlightened friend shared with me this manual page. So I finally had some options, it seemed. It took a few hours of poking but I finally got everything working with VirtualBox and it is absolutely wonderful.
So here is how I did it on Windows 7:
- Install VirtualBox as normal.
- I copied the .vmdk files I'd used to set this up with VMWare. If you don't have these files to copy then create a new VM in VirtualBox of the appropriate flavor of linux and do the installation as per the original article.
- You will need to support ReiserFS and Samba, make sure your setup includes these.
- Create the new .vmdk as per the linked page from the VirtualBox. You can find the drive # by populating volume properties from the device manager.
- In order for the raw disk access to work under Windows 7 you will need to set the compatibility options on C:\Program Files\Sun\VirtualBox\VirtualBox.exe to run it as administrator.
- Link the new vmdk first to VirtualBox with the Virtual Media Manager, open the VMM and click "Add" to add the vmdk(s)
- Create a new virtual machine of the appropriate flavor of linux. If you copied files from a VMWare installation you will need to add a SATA bus to the VM's storage configuration and add the vmdk's to that controller. If you installed from scratch in VirtualBox don't do this now, it will only complicate your life.
- Set the options on C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe to run as administrator.
- Create a new text file on your desktop, name it "Start VM.vbs"
- In the file, paste:
Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe" & chr(34) & " --startvm VBoxReiser", 0 Set WshShell = Nothing
- Replace VBoxReiser with the name of the VM you created above
- Save this file
VBoxManage controlvm VMNAME acpipowerbutton
This will shut the VM down, assuming it is responding to ACPI signals.
I've been running this for a few days now and it is so much better. I no longer need to dread rebooting because of the horrifying start times from VMWare. It was fun to do a nice bit of tech stuff out of work.