Disk Formats

QB-DF-001 Technical

QuantaBox manages virtual disks through qemu-img. This document covers the supported formats, the operations performed, and encryption details. For the user-facing view, see Storage and Disks.

Supported Formats #

FormatIdentifierSparseSnapshotsNotes
QCOW2qcow2YesYesDefault. Grows on demand; supports internal snapshots and compression.
QVDqcow2 (encrypted)YesYesQuantaBox encrypted disk -- a LUKS-encrypted QCOW2.
RawrawNo*NoFlat image; fastest, no internal snapshots.
VMDKvmdkYes--VMware interoperability.
VDIvdiYes--VirtualBox interoperability.
Note: Raw images may be sparse at the filesystem level on filesystems that support sparse files, but the format itself has no metadata.

Operations #

QuantaBox's disk module wraps qemu-img:

Create

qemu-img create -f <format> [-o <options>] <path> <sizeM>

For QCOW2/QVD, QuantaBox applies tuning options cluster_size=65536,lazy_refcounts=on. When encryption is requested it adds LUKS options (see Encryption).

Resize

qemu-img resize <path> <newSizeM>

Enlarges the image container only. The guest must then grow its partition and filesystem. Shrinking is not supported.

Info

qemu-img info --output=json <path>

Parsed into a DiskInfo with: format, virtual_size, actual_size, cluster_size, encrypted, and backing_file.

Convert

qemu-img convert -p -O <format> <src> <dst>

Produces a new image in the target format, leaving the source intact. Used for format migration and for compacting Raw into sparse QCOW2.

Snapshots #

Snapshots use qemu-img snapshot and therefore require QCOW2/QVD:

OperationCommand
Createqemu-img snapshot -c <name> <disk>
Deleteqemu-img snapshot -d <name> <disk>
Listqemu-img snapshot -l <disk>
Restore (apply)qemu-img snapshot -a <name> <disk>

Listed snapshots expose id, tag, vm_size, date, and time. See Snapshots.

Encryption #

QuantaBox supports two complementary encryption paths:

LUKS-in-QCOW2 (at create time)

When a disk is created encrypted, QuantaBox passes LUKS options to qemu-img:

-o encrypt.format=luks,encrypt.key-secret=sec0

The disk's data is then protected by the QCOW2/LUKS layer with a key secret supplied at runtime. This is the .qvd disk type.

QuantaBox sector encryption (crypto crate)

The quantabox-crypto crate also implements a sector-based AES-256-GCM scheme used for encrypted export/import and backups, where each sector is encrypted independently with a counter-derived nonce. This is described in Cryptography Internals.

Note: Encryption is selected at creation time. To encrypt an existing unencrypted disk, create a new encrypted disk and migrate, or export and re-import as an encrypted package.

Choosing a Format (Guidance) #

  • QCOW2 / QVD -- default for almost everything; sparse and snapshot-capable.
  • Raw -- only when you need maximum throughput and no internal snapshots.
  • VMDK / VDI -- only for interoperability with other hypervisors.

Storage Layout #

Each disk lives in its VM's folder under the data directory; QCOW2/QVD images are sparse, so a large virtual size consumes only the space actually written. See Architecture - Data Directory.