Disk Formats
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 #
| Format | Identifier | Sparse | Snapshots | Notes |
|---|---|---|---|---|
| QCOW2 | qcow2 | Yes | Yes | Default. Grows on demand; supports internal snapshots and compression. |
| QVD | qcow2 (encrypted) | Yes | Yes | QuantaBox encrypted disk -- a LUKS-encrypted QCOW2. |
| Raw | raw | No* | No | Flat image; fastest, no internal snapshots. |
| VMDK | vmdk | Yes | -- | VMware interoperability. |
| VDI | vdi | Yes | -- | VirtualBox interoperability. |
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:
| Operation | Command |
|---|---|
| Create | qemu-img snapshot -c <name> <disk> |
| Delete | qemu-img snapshot -d <name> <disk> |
| List | qemu-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.
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.