Virtual disk image

Also known as: virtual disk

On this page 8

A virtual disk image is a file, or a set of files, that holds the complete block-level contents of a disk used by a virtual machine. In virtualization, the hypervisor opens the image and presents it to the guest operating system as an ordinary physical drive, so the guest partitions, formats and boots from it without knowing that every sector actually lives inside a file on a host datastore.

The concept is central to cloud and data center operations because the image is the unit of portability, backup and provisioning for a workload. Copying, cloning, snapshotting or migrating a machine largely means manipulating its virtual disk, often called simply a virtual disk, together with a small configuration file that describes the rest of the virtual hardware.

How a virtual disk image maps guest blocks to host storage

A virtual disk image works by translating guest block addresses into offsets inside a host file or storage object. When the guest writes sector 2,048, the hypervisor or its storage layer looks up where that sector belongs in the image and performs the corresponding read or write on the host. The guest sees a virtual controller such as SATA, SCSI, NVMe or a paravirtualized virtio-blk device, and never touches the underlying file directly.

Most modern formats divide the disk into fixed grains, clusters or blocks, typically 64 KiB to 2 MiB, and keep a metadata table that records which ranges are allocated. Unallocated ranges read back as zeros without occupying space. This mapping layer is what enables thin provisioning, snapshots and differencing chains, and it is also the source of the small performance overhead that raw devices avoid.

The image itself is passive data. A separate VM configuration file names the image, the controller type and the boot order. Attaching the same image to another machine, provided the guest drivers match, effectively moves the installed operating system and its data with it.

Common virtual disk image formats

Each hypervisor family has a native image format, and conversion between them is routine but not always lossless for metadata. The table below summarizes the formats most often met in practice.

FormatPrimary platformNotable properties
VMDKVMware ESXi, VMware WorkstationDescriptor plus extent files; thin or thick variants
VHDXHyper-VUp to 64 TB, metadata journaling, 4 KB sector support
VHDLegacy Hyper-V, older cloud imports2 TB limit, fixed or dynamic, still used for uploads
QCOW2KVM and QEMU, OpenStackCopy-on-write, internal snapshots, compression, encryption
VDIVirtualBoxNative dynamic format; distinct from the desktop acronym VDI
Raw imageKVM, Xen, FirecrackerSector-for-sector copy, no metadata, fastest path
Widely used virtual disk image formats

Cloud providers usually hide the format behind a block storage service: the customer sees a volume, while the platform stores it as replicated chunks. Import and export tools, however, still expect one of these file formats, which is why qemu-img convert and similar utilities appear in nearly every migration runbook.

Provisioning modes and their trade-offs

The provisioning mode decides when host space is allocated and therefore shapes both capacity planning and write performance. Administrators choose it when creating the image, and changing it later requires a conversion or storage migration.

ModeSpace allocationMain advantageMain risk
Thin provisionedOn first writeHigh storage efficiencyDatastore overcommit and sudden exhaustion
Thick lazy zeroedAt creation, zeroed on first writeGuaranteed capacityFirst-write latency penalty
Thick eager zeroedAt creation, zeroed immediatelyPredictable write latencySlow creation, no space savings
Differencing or linkedOnly changed blocksFast cloning from a parentParent corruption breaks every child
Provisioning modes compared

Thin provisioning is the default in most clouds and desktop tools, but it creates overcommit risk: if guests collectively write more than the datastore holds, every machine on it can pause or fail writes. Monitoring actual versus provisioned capacity and enabling TRIM or UNMAP in the guest are the standard countermeasures, because without them deleted guest files never return space to the host.

Snapshots, chains and copy-on-write

A VM snapshot of a disk is normally implemented by freezing the current image and redirecting new writes to a child delta file. Reads first check the child and fall back to the parent for blocks that have not changed. This copy-on-write chain makes snapshots nearly instantaneous to create.

Long chains carry real costs. Every read may traverse several layers, deltas grow with every changed block, and consolidating a deep chain can take hours and heavy I/O. Experienced operators therefore treat snapshots as short-lived safety points of hours or days, not as a backup strategy, and they keep chains to only a few levels.

  • Golden images serve as read-only parents for many linked clones in VDI pools and test labs.
  • Backup software takes a brief snapshot, copies the frozen parent, then merges the delta back.
  • Changed block tracking records modified regions so incremental backups avoid full scans.

A virtual disk image is one of several ways to give a guest storage, and the right choice depends on portability, performance and management needs. The comparison below places it beside neighboring approaches.

OptionHow the guest sees itBest suited for
Virtual disk imageEmulated or paravirtual disk backed by a fileGeneral workloads that need snapshots and mobility
Raw device mappingDirect access to a LUNClustering software and storage array features
Passthrough with SR-IOV or NVMeNear-physical deviceLatency-critical databases and analytics
Network file shareMounted file system, not a block deviceShared data across many machines
Image files versus alternative guest storage

With virtio drivers and a modern format on fast storage, the overhead of an image file versus a raw device is usually within a few percent for throughput, although tail latency under heavy random writes can differ more. Workloads that need the last margin often use raw images or passthrough and give up some flexibility in exchange.

Operational risks and common mistakes

Most problems with virtual disk images come from mismanaged metadata and capacity, not from the guest itself. The following table links frequent symptoms with their causes and fixes.

SymptomLikely causeRecommended fix
VM pauses with a no-space errorThin disks overcommitted the datastoreAdd capacity, migrate disks, set alerts
Disk performance degrades over monthsForgotten snapshot chainConsolidate and audit snapshots regularly
Converted VM will not bootMissing storage driver or wrong controllerInject drivers before conversion, match controller
Image grows despite deleted filesGuest discard disabledEnable TRIM or UNMAP and compact the image
Clones share identical identifiersImage copied without generalizationRun sysprep or regenerate machine IDs
Typical failures and remedies

Security deserves equal attention. An image file contains every byte the guest ever stored, including credentials and deleted data in unallocated regions, so copies must be encrypted at rest and access to datastores tightly controlled. Images downloaded from public sources should be treated as untrusted software and scanned before use.

The short version

A virtual disk image is a hard drive that exists as a file. The virtual machine believes it has a real disk, but everything it saves actually lands inside one large file on another computer or storage system.

Because the whole disk is just a file, it can be copied, moved and backed up like any other document. That is why a server can be duplicated in minutes or moved to another host without opening a single computer case.

Where it makes a difference

A software company runs a training lab in which 40 students each need an identical Windows server with a preinstalled database. The infrastructure team builds one golden image of 60 GB, generalizes it with sysprep and marks it read-only. Each student machine is then created as a linked clone whose differencing disk starts at a few megabytes.

Provisioning all 40 machines takes under ten minutes instead of several hours, and total storage use after a week of exercises stays near 300 GB rather than the 2.4 TB that full copies would require. At the end of the course, the team deletes the child disks and the lab is clean again, while the parent image remains ready for the next group.