Introduction
VMDK is the virtual disk format of VMware. Every
VMware virtual machine, in Workstation, Fusion or ESXi, keeps its hard disk in one or more
.vmdk files. Other virtualisation software reads it too, and it is the disk
format inside OVF and OVA appliance packages.
A virtual disk can be stored in several ways: as one growing file, split into pieces of 2 GB, or as a fully allocated flat file. The type is written in a short text descriptor that tells the software which files hold the disk.
Structure
Every VMDK disk has a text descriptor. It may be a small file of its own, or embedded
inside the first data file. It starts with # Disk DescriptorFile and gives
a content ID, the ID of any parent disk, the createType (such as
monolithicSparse, twoGbMaxExtentSparse,
monolithicFlat or streamOptimized), one line per extent naming
its access, size in sectors, type and file, and ddb. lines with the disk’s
geometry and adapter type.
A flat extent is the raw disk, sector by sector. A sparse extent starts with a header
whose magic number reads KDMV in the file (the bytes 4B 44 4D 56).
The header gives the version, the disk’s capacity, the grain size, which is the unit of
allocation and 64 KB by default, and the positions of the descriptor and the grain
directory. The grain directory points to grain tables, and each grain table entry points
to a grain in the file, or is zero when that part of the disk has never been written.
0Sparse headerKDMV, version, capacity, grain size, table offsets512 bytes…Embedded descriptor the text descriptor, in a monolithic sparse filevaries…Grain directory and grain tablesvaries…Grains the written parts of the diskrepeated
Links
Software
- VMware Workstation Pro (Windows, Linux)
- VMware Fusion (macOS)
- VMware ESXi
- VirtualBox (Windows, macOS, Linux)
- QEMU and qemu-img, which run and convert VMDK files (Windows, macOS, Linux)
- 7-Zip, which opens VMDK files like an archive (Windows)
Developers
- libvmdk, C library with Python bindings that reads VMDK files
- libguestfs, C library and tools for reading and changing the files inside disk images