Converting the virtual machine images is very easy, but many guides suggest you to convert from VDI to RAW and then from RAW to QCOW2. It doesn’t really make sense, you’ll waste double the time, and it’s gonna be hours if the drive is big.
To convert from VDI to QCOW2 just use qemu-img:
qemu-img convert -f vdi -O qcow2 [VBOX-IMAGE.vdi] [KVM-IMAGE.qcow2]
If the virtual machine was Windows-based, probably will crash at first boot, because of the virtual hardware changes, and because there are no virtio drivers installed (unless you make a VM with IDE emulation)
For fix the BSOD at boot you can do onf of this:
- Do a refresh install from the setup CD (and a virtual floppy with virtio drivers)
- Before migrating install this patch: https://www.virtualbox.org/attachment/wiki/Migrate_Windows/MergeIDE.zip
- Try to recover the install using Hiren Boot CD
Personally I chose the first option, but then I had to install again hundreds and hundreds of security updates, it would have been better if I installed the patch before migrating.
Update: I noticed that the converted Windows XP VM uses the cpu at 100% even when idle. This is a nasty bug that would take ages to fix. I tried to force enabling ACPI, but all I can get is a BSOD on boot. I’ll just scratch the VM and rebuild it…
2 thoughts on “How to convert a VM from VirtualBox to KVM”
Thanks for another magnificent post. Where else could anyone get that kind of information in such a perfect manner
of writing? I’ve a presentation next week, and
I’m at the look for such information.
Thanks for another magnificent spam comment. I removed your spam link tho