/
Converting between Image formats

Converting between Image formats

Converting images from one format to another is generally straightforward.

Install qemu-utils

(ubuntu) : apt-get install qemu-utils

qemu-img convert: raw, qcow2, VDI, VMDK

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

to convert from vdi to raw, you can do:

qemu-img convert -f vdi -O raw clovr-standard-2012-11-16-20-05-15.vdi clovr.img

To convert from vdi to qcow2:

qemu-img convert -f vdi -O qcow2 clovr-standard-2012-11-16-20-05-15.vdi clovr-standard-2012-11-16-20-05-15.qcow2

Reference:
1. http://docs.openstack.org/image-guide/content/ch_converting.html

Related content

Mounting raw and qcow2 VM disk images
Mounting raw and qcow2 VM disk images
More like this
Converting an externally created VirtualBox or Vmware image for use in nectar
Converting an externally created VirtualBox or Vmware image for use in nectar
More like this
Download a nectar snapshot image
Download a nectar snapshot image
More like this
Mapping QCloud SFTP connections as a Windows mapped drive
Mapping QCloud SFTP connections as a Windows mapped drive
More like this