Installation guide

Command format:
# qemu-img convert [-c] [-e] [-f format] filename [-O output_format] output_filename
Convert the disk image filename to disk image output_filename using format output_format.
The disk image can be optionally encrypted with the -e option or compressed with the -c option.
Only the format "qcow" supports encryption or compression. the compression is read-only. it means
that if a compressed sector is rewritten, then it is rewritten as uncompressed data.
The encryption uses the AES format with very secure 128-bit keys. Use a long password (over 16
characters) to get maximum protection.
Image conversion is also useful to get smaller image when using a format which can grow, such as
qcow or cow. The empty sectors are detected and suppressed from the destination image.
g et tin g imag e in fo rmat ion
the info parameter displays information about a disk image. the format for the info option is as
follows:
# qemu-img info [-f format] filename
give information about the disk image filename. use it in particular to know the size reserved on disk
which can be different from the displayed size. if vm snapshots are stored in the disk image, they are
displayed too.
Su p p o rt ed f o rmat s
The format of an image is usually guessed automatically. The following formats are supported:
raw
Raw disk image format (default). This format has the advantage of being simple and easily
exportable to all other emulators. If your file system supports holes (for example in ext2 or
ext3 on Linux or NTFS on Windows), then only the written sectors will reserve space. Use
qemu-img info to know the real size used by the image or ls -ls on Unix/Linux.
qcow2
QEMU image format, the most versatile format. Use it to have smaller images (useful if your
file system does not supports holes, for example: on Windows), optional AES encryption,
zlib based compression and support of multiple VM snapshots.
qcow
Old QEMU image format. Only included for compatibility with older versions.
cow
User Mode Linux Copy On Write image format. The cow format is included only for
compatibility with previous versions. It does not work with Windows.
vmdk
VMware 3 and 4 compatible image format.
cloop
Chapt er 33. T ips and t ricks
311