0% found this document useful (0 votes)
93 views1 page

Converting Between Image Formats On QEMU

The document provides instructions for converting images between various formats using the qemu-img and VBoxManage command-line tools. It details specific commands for converting between formats such as qcow2, vmdk, and raw, along with necessary flags and considerations for Windows users. Additionally, it includes a method for converting VDI images created in VirtualBox to raw format.

Uploaded by

R2D2 Sanshiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views1 page

Converting Between Image Formats On QEMU

The document provides instructions for converting images between various formats using the qemu-img and VBoxManage command-line tools. It details specific commands for converting between formats such as qcow2, vmdk, and raw, along with necessary flags and considerations for Windows users. Additionally, it includes a method for converting VDI images created in VirtualBox to raw format.

Uploaded by

R2D2 Sanshiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Converting between image formats

Converting images from one format to another is generally straightforward.

qemu-img convert: raw, qcow2, qed, vdi, vmdk, vhd¶


The qemu-img convert command can do conversion between multiple formats, including qcow2, qed, raw, vdi, vhd, and vmdk.

qemu-img format strings¶

Image format Argument to qemu-img

QCOW2 (KVM, Xen) qcow2

QED (KVM) qed

raw raw

VDI (VirtualBox) vdi

VHD (Hyper-V) vpc

VMDK (VMware) vmdk

This example will convert a raw image file named [Link] to a qcow2 image file.

$ qemu-img convert -f raw -O qcow2 [Link] image.qcow2

Run the following command to convert a vmdk image file to a raw image file.

$ qemu-img convert -f vmdk -O raw [Link] [Link]

Run the following command to convert a vmdk image file to a qcow2 image file.

$ qemu-img convert -f vmdk -O qcow2 [Link] image.qcow2

The -f format flag is optional. If omitted, qemu-img will try to infer the image format.

When converting an image file with Windows, ensure the virtio driver is installed. Otherwise, you will get a blue screen when
launching the image due to lack of the virtio driver. Another option is to set the image properties as below when you update the
image in the Image service to avoid this issue, but it will reduce virtual machine performance significantly.

$ openstack image set --property hw_disk_bus='ide' image_name_or_id

VBoxManage: VDI (VirtualBox) to raw


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, and Linux, 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/[Link] [Link] --format raw

You might also like