Monday, February 8, 2010

Moving a Windows 2008 R2 Server from Vmware to Virtualbox

I was afraid this wasn't going to be straight forward, but it isn't too difficult.

One advice: Don't try to run vmware and virtualbox at the same time on the same computer, it might crash everything.

Try to remove vmware tools before you move the vmdk to virtualbox.

Steps:
Make a copy of your vmdk in case anything fails.
Write down all the hardware settings for the vmware instance you are to move.

I had the following settings on vmware to consider and move:
  1. SCSI controller LSI Logic
  2. 1 Network adapter getting IP based on the mac address
  3. 1 Host-Only network adapter
All seemed to be supported on VirtualBox as well, so I started creating the virtualbox
Steps for VBoxManage. (i'm not going into details, as it's better to read the manual for each option, if you wonder)

VBoxManage createvm -name "Windows2008_R2_x64_vbox" -register
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --memory "1200" --acpi on --cpus 1 --pae on --ioapic on
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --hwvirtex on --vtxvpid on
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --nic1 bridged --bridgeadapter1 br0 --macaddress1 000c123456789
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --nictype1 82540EM
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --nic2 hostonly --hostonlyadapter2 vboxnet0 --macaddress2 000c12345678a
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --nictype2 82540EM
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --ostype Windows2008_64
VBoxManage storagectl "Windows2008_R2_x64_vbox" --name "IDE Controller" --add ide
VBoxManage storageattach "Windows2008_R2_x64_vbox" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "/mnt/vboxes/win2008r2x64_vmware.vmdk"

Important not to forget the Virtual RDP:
VBoxManage modifyvm "Windows2008_R2_x64_vbox" --vrdp on --vrdpport 12345 --vrdpmulticon on --vrdpauthtype external

Try booting, and most likely it should all be fine.
Now why did I add a IDE Controller instead of a SCSI Controller?

I tried using SCSI controllers, but I got a blue screen with stop error 7b. This tells me that Windows cannot use the boot device, because of some access problems through the controller. I tried the IDE Controller, as that usually works for clients (Win 7, Vista, XP), and it worked perfect for Win 2008 Server as well.

You will need to check if any old vmware-drivers are still "hanging around" and install the Guest additions.
I don't know if there is a performance increase in using a VDI compared to a VMDK. The good thing about keeping it as a VMDK is that you can always "go back" to evil vmware.
For moving Ubuntu clients. Do similar steps as above, but you can keep the SCSI controller, move to a SATA Controller, or do what you like. Everything just works with Ubuntu!

Update (03.feb-2012): If you have the time, it's better to reinstall. At least I experienced better performance for the servers that were reinstalled instead of converted.