Skip to main content

VirtualBox to KVM Migration

What:

Virtualbox is a nice desktop virtualization software from erstwhile Sun Inc.  I used the personal use as well as open edition of it for quite sometime. However, could not resist the temptation to migrate to KVM, given its increasing roars in the virtualization space - both for desktop as well as server side. Not having a good tool to manage the VMs was a shortcoming of KVM for sometime. However, with Virt-Manger, this seems to have changed quite a lot. And so I started to migrate my windows image to KVM based.

Source:
Host OS: Ubuntu 10.04
Virtualization tool: VirtualBox
Guest OS: Windows XP Sp3

Target: 

Host OS: Ubuntu 10.04
Virtualization tool: KVM
Guest OS: Windows XP Sp3
objective is migrate this guest image to KVM so that the migration is seemless.

How:

Pre-planning:
  • Shut off windows XP gracefully. It probably might make a difference. But in anycase, will be a good idea rather than land up in surprise
  • You need reasonable space. nearly 3 times of the size of the windows xp file disc. 
  • You might need WindowsXP install iso or the setup disc. (I needed it)
Migrate the disc:
  • Migrate the file disc from .vdi format to .img first
    VBoxManage clonehd --format RAW windowsxp.vdi windowsxp.img
  • Migrate to .qcow2 format
    qemu-img convert -f raw windowsxp.img -O qcow2 windowsxp
Setup KVM:
  • Check if your hardware support hardware virtualization. If not, you can use qemu else use KVM
    cat /proc/cpuinfo | egrep "(vmx|svm)"
  • If the above command returned something, you should be all set to use KVM
  • Install kvm and virt-manager. You should be able to install these using synaptics or Ubuntu Software Center. There are command line tricks but do you care?
  • Configure a new VM with image as windowsxp.qcow
  • Run the new VM
  • In my case, I got my first bummer here - Blue Screen of Death
  • After a bit of googling, i found repairing the windows xp is the way to go. 
  • Boot the VM from the windows xp ISO or the boot CD.
  • Go the repair option on the installed image.
  • It took as long as it takes to install windows xp. However, it retained the entire OS as is. I have an active directory join on this VM, this was intact. No software was removed or modified.
  • In other words, when repair finished, i could login to the KVM based Windows XP as if I was the previous virtualbox VM.

Overall, a pleasant experience and a quick one too.
References:
  • http://blog.bodhizazen.net/linux/convert-virtualbox-vdi-to-kvm-qcow/
  • http://blog.mymediasystem.net/uncategorized/vmware-kvm-migration-guide/
  • http://outlyer.net/howtos-linux/kvm-qemu-notes/

Comments

Unknown said…
Cao,
thanx for You solution :-)

Popular posts from this blog

Connecting Ubuntu to Belkin N+ router USB drive

I recently purchased Belkin's N+ Wireless router. It worked great. Easy to set up and comes up LEDs that should help troubleshoot where the problem is. One of the other features is that it comes with a mount point for USB drive. This is good since it just provides an easy way to create a local NAS. You keep the drive in one place and access it from any of your laptops. Connecting it from Windows is easy. The usual \\belkin N+\Drive Name works. However, on linux, it did not work out of box. Looked like trouble with space in the name at first. But when I tried with IP address and it did work. I inferred space may not be the issue. I tried few suggestions from ... http://alittlecharm.blogspot.com/2009/06/connecting-ubuntu-to-belkin-n-usb-drive.html .. this did not work for me. Not as it is, at least. One reason i avoided to implement these suggestion as is that it required to install smb4k which would have also installed base kde and I wasn't in big favor of installing the whole t...

CoLinux - Setting it up on Windows XP

About this article I wanted to write an article thats quick and simple get colinux working on a Windows Host. I have skipped details that can be referred elsewhere in the spirit of keeping this article simple. The infrastructure used: Laptop: Toshiba Portege A 200 Host OS: Windows XP Guest OS: Ubuntu 8.04 (alpha 6) What is Colinux Colinux or Cooperative linux is an easy way to run Windows and Linux simultaneously on the same machine without the hassle of partitioning. More at ... http://colinux.org/ Preparing Setup Space Requirements Ensure you have ample space on your drive depending on how full you want to enjoy linux. Below numbers may help you decide if you have enough space to set up colinux: Bare minimum non-gui colinux: 2G Gnome/Kde based colinux: 5G For use as full time OS: 10G+ Software needed Qemu QEMU Accelerator Module Colinux Wincap Ubuntu or any linux distribution of your choice. I used ubuntu for this article. And you should download the .iso file f...