VirtualBox to QEMU
Recently, I had cause to convert a VirtualBox virtual machine to one compatible with QEMU and KVM. A quick search found me multiple methods for converting an image QEMU -> VirtualBox but nothing helping me to go from VirtualBox -> QEMU. After asking on the PLUG mailing list, I got some help and managed to convert it without any issues. In order to do it, you’ll need the vditool tool contained in the virtualbox-ose package available from the Debian repositories. Here’s how I got it working:
vditool COPYDD vbox-image.vdi raw-image.imgqemu-img convert -f raw raw-image.img -O qcow2 qemu-image.qcow
The first step copies the contents of the image (*.vdi is the VirtualBox filesystem image extension) to a raw disk image. Be advised: this file will be the full size of the virtual hard drive. That means that, unlike *.vdi and *.qcow formats, if the virtual disk has a maximum capacity of 8Gb, the raw image will be 8Gb in size regardless of how full the disk is.
Once you have the raw image, run the second step which uses the QEMU disk image manipulation tool, qemu-img, to convert the raw image into the QCOW2 format. The new QEMU image will be much smaller than the raw image was and it can be made smaller by passing qemu-img the -c option to enable transparent compression. However, seeing as how this just uses zlib on each cluster, this might introduce more overhead to I/O than is desired and will most likely degrade your overall VM performance.


















Thank you very much! This is just what i’m looking for! Thank you for sharing your experience! Have a nice day!
Thank you for this great post. vditools can be simple download from: http://www.virtualbox.org/download/testcase/vditool
Just what i was looking for, thanks!
Thanks for the information!
Thanks a lot. This is just what i needed after virtualbox-ose couldn’t support ubuntu-server. hopefully qemu can (fingers crossed X)