Convert RAW image to Qcow2, VDI, VMDK & VHD
I. Convert Raw image to Qcow2:
qemu-img convert -f raw image.raw -O qcow2 image.qcow2
II. Convert Raw image to VDI:
qemu-img convert -f raw image.raw -O vdi image.vdi
III. Convert Raw image to VMDK:
qemu-img convert -f raw image.raw -O vmdk image.vmdk
IV. Convert Raw image to VHD:
qemu-img convert -f raw image.raw -O vpc image.vhd
Convert Qcow2 image to RAW, VDI, VMDK & VHD
I. Convert Qcow2 image to RAW:
qemu-img convert -f qcow2 image.qcow2 -O raw image.raw
II. Convert Qcow2 image to VDI:
qemu-img convert -f qcow2 image.qcow2 -O vdi image.vdi
III. Convert Qcow2 image to VMDK:
qemu-img convert -f qcow2 image.qcow2 -O vmdk image.vmdk
IV. Convert Qcow2 image to VHD:
qemu-img convert -f qcow2 image.qcow2 -O vpc image.vhd
Convert VDI image to RAW, Qcow2, VMDK & VHD
I. Convert VDI image to RAW:
qemu-img convert -f vdi image.vdi -O raw image.raw
II. Convert VDI image to Qcow2:
qemu-img convert -f vdi image.vdi -O qcow2 image.qcow2
III. Convert VDI image to VMDK:
qemu-img convert -f vdi image.vdi -O vmdk image.vmdk
IV. Convert VDI image to VHD:
qemu-img convert -f vdi image.vdi -O vpc image.vhd
Convert VMDK image to RAW, Qcow2, VDI & VHD
I. Convert VMDK image to RAW:
qemu-img convert -f vmdk image.vmdk -O raw image.raw
II. Convert VMDK image to Qcow2:
qemu-img convert -f vmdk image.vmdk -O qcow2 image.qcow2
III. Convert VMDK image to VDI:
qemu-img convert -f vmdk image.vmdk -O vdi image.vdi
IV. Convert VMDK image to VHD:
qemu-img convert -f vmdk image.vmdk -O vpc image.vhd
Convert VHD image to RAW, Qcow2, VDI & VMDK
I. Convert VHD image to RAW:
qemu-img convert -f vpc image.vhd -O raw image.raw
II. Convert VHD image to Qcow2:
qemu-img convert -f vpc image.vhd -O qcow2 image.qcow2
III. Convert VHD image to VDI:
qemu-img convert -f vhd image.vhd -O vdi image.vdi
IV. Convert VHD image to VMDK:
qemu-img convert -f vpc image.vhd -O vmdk image.vmdk
In conclusion, we have discussed how to convert disk images to various formats using qemu-img in Ubuntu.