All HowTo's Linux Redhat, Fedora and CentOS Linux Ubuntu, Mint & Debian Linux Virtualization

Migrate a VirtualBox Disk Image (.vdi) to a QEMU Image (.img)

A very simple task with the correct tool, the tool in question is qemu-img. This tool is pulled in when you install QEMU on Gentoo,Redhat and Ubuntu however on Redhat and Ubuntu there is a separate package for it also. On Gentoo if you only wanted qemu-img and nothing else you could do a build from source.

Ubuntu:

apt-get install qemu-utils

Rehat:

yum install qemu-img

Now for the magic we need to call qemu-img, and use the convert function with the -f switch which is the format of the input file (vdi for virtualbox images) then -O and that is the output format in this case raw for .img files, then just give it the path to the files.

qemu-img convert -f vdi -O raw ~/"VirtualBox VMs"/TestMachine/TestMachine.vdi ~/Desktop/TestMachine1.img

That is it now you just have to build your QEMU/KVM machine using your choice of tool and you can assign your disk to it, ensure you tell the machine it is looking at a raw image if you have to and then it should just boot.

Quick and easy.

Leave a Reply

Your email address will not be published. Required fields are marked *