Tuesday, March 13, 2012

Migrate from Virtualbox to KVM

Some days ago I decided to migrate some of my Oracle Virtualbox test VM on a KVM server.

Why? easy, KVM\QEMU is better Oracle Virtualbox for a lot of reason. Probably this link will be enough to convince you.


Have a computer with virtualbox make everything easier but I wanted to do everything without virtuabox. (Link with virtuabox)

So we have to converto VDI images into somethink KVM can read. I used a simple ".RAW" images. This step is easy, and you can find tons of post online:
http://blog.bodhizazen.net/linux/convert-virtualbox-vdi-to-kvm-qcow/
http://xpapad.wordpress.com/2010/02/21/migrating-from-virtualbox-to-vmware-in-linux/
http://www.dedoimedo.com/computers/virtualbox-convert.html
http://kevin.deldycke.com/2007/04/how-to-grow-any-qemu-system-image/

Edit 16/12/12: Anyway this will make a .RAW as big as the dimension assigned to your virtual hard drive.

I started with my VirtualBox VM Debian6 test server, where I usually try new stuff before put it on a real PC or anyway in the main VM.
Convert the hard drive from VDI to RAW, I used the RAW image inside a KVM VM and everything worked fine.

Windows XP:
After conver the VDI image and put the RAW inside a KVM VM i had this issue:

 0x0000007B
BLUE SCREEN OF DEATH (BSOD)
 
This blue screen arrived at the first second third and ALL boot after the conversion....
I searched and I found something.
Talking on IRC I realized the problem was the hard drive controller.
What we have to do? touch a bit WinXp registry... how to do it easily?
I found 2 solutions:
  1. With virtualbox: This "patch". Run it before your turn off the last time your virtualbox machine before the migration. I will say to XP to accept all HD chipset (or something similar)
  2. Without virtualbox: HIREN's boot cd or as a lot of SysAdmin know it... Ass saver! Simply boot micro XP goes on the tools and find "Fix Hard disk controller" under Registry. And DONE!


I found another problem, something I really though I wasn't to solve it fast, read a lot of stuff, like reinstall windows over the existing one or make a brand new VM.
I didn't want! so I pass more time searching than the time I needed to reinstall windows! But I Found it

Fist the problem (link):

So what happened? I haven't only moved my VM from Virtualbox to KVM on the same machine but I moved it from an AMD Athlon x2 to two different PC (to test) an AMD phenon x6 and Intel SB i5. On the AMD I haven't had this problem, but on the Intel I had! So I had problem because the processor type isn't the same.

Thanks to this AWESOME GUY we have a solution for this problem too....
http://blogs.msdn.com/b/virtual_pc_guy/archive/2005/10/24/484461.aspx

I just start my VM XP in safe mode and edit the register like he wrote

And here we are! true you won't have reconized the CPU on hardware manager on Windows, but who care it's Windows! :D

Hope this post will help somebody.
Have a nice day!

5 comments:

  1. "Hope this post will help somebody."
    **** yeah, this really did the trick!

    Thank you very much for your efforts. As I still retain the doubtful pleasure of supporting some client's WinXP, this came in very handy when I moved my VMs from VirtualBox to KVM.

    ReplyDelete
  2. This post really contains good information about the windows migration.

    ReplyDelete
  3. Thanks a lot. Hiren's worked. Saved me a lot of time ..

    ReplyDelete
  4. Thanks a lot, spent somes hours to fix this, and among a lot of solutions, yours was the good one !

    ReplyDelete
  5. Thanks. I used Hiren's Boot Disk as suggested and it worked. The Current version is based on Windows 10, but version 14.0 in the legacy backports runs XP as per your screenshot. You have to define the root (ie. C:\Windows), but otherwise simple enough.

    ReplyDelete