LinuxCommandLibrary

qemu-img

Create and manage QEMU disk images

TLDR

Create disk image

$ qemu-img create -f [qcow2] [disk.qcow2] [20G]
copy
Convert image format
$ qemu-img convert -f [raw] -O [qcow2] [input.img] [output.qcow2]
copy
Show image info
$ qemu-img info [disk.qcow2]
copy
Resize image
$ qemu-img resize [disk.qcow2] +[10G]
copy
Create snapshot
$ qemu-img snapshot -c [snapshot1] [disk.qcow2]
copy

SYNOPSIS

qemu-img command [options]

DESCRIPTION

qemu-img is the QEMU disk image utility for creating, converting, resizing, and inspecting virtual machine disk images. It supports multiple formats including qcow2, raw, vmdk, vdi, and vhd, making it essential for managing virtual machine storage and migrating between hypervisors.
The create command builds new images with optional thin provisioning, while convert transforms between formats and can compress or encrypt output. The info command displays image metadata including format, virtual size, and snapshot details. Snapshots within qcow2 images can be created and managed for point-in-time recovery.

PARAMETERS

create

Create new image.
convert
Convert format.
info
Show image info.
resize
Resize image.
snapshot
Manage snapshots.
-f FORMAT
Image format.
-O FORMAT
Output format.

CAVEATS

Part of QEMU suite. Various format options.

HISTORY

qemu-img is part of QEMU for disk image management.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community