Converting images from one format to another is generally straightforward.
The qemu-img convert command can do conversion between multiple formats, including raw, qcow2, VDI (VirtualBox), VMDK (VMWare) and VHD (Hyper-V).
Image format | Argument to qemu-img |
---|---|
raw | raw |
qcow2 | qcow2 |
VDI (VirtualBox) | vdi |
VMDK (VMWare) | vmdk |
VHD (Hyper-V) | vpc |
This example will convert a raw image file named centos63.dsk to a qcow2 image file.
$ qemu-img convert -f raw -O qcow2 centos64.dsk centos64.qcow2
To convert from vmdk to raw, you would do:
$ qemu-img convert -f vmdk -O raw centos64.vmdk centos64.img
Note | |
---|---|
The |
If you've created a VDI image using VirtualBox, you can convert it to raw format using
the VBoxManage command-line tool that ships with VirtualBox. On Mac
OS X, VirtualBox stores images by default in the ~/VirtualBox VMs/
directory. The following example creates a raw image in the current directory from a
VirtualBox VDI
image.
$ VBoxManage clonehd ~/VirtualBox\ VMs/fedora18.vdi fedora18.img --format raw