Introduction
VHDX is the virtual hard disk format of Microsoft’s Hyper-V, introduced with Windows Server 2012 and Windows 8 as the successor to VHD. A VHDX disk can be up to 64 TB, against about 2 TB for VHD, and it keeps a log of changes to its own tables so that a power failure does not corrupt it.
Windows can attach a VHDX file as an ordinary drive, and can even start from one. Microsoft publishes the specification as MS-VHDX.
Structure
The file is divided into regions aligned to 1 MB. It starts with a 64 KB file type
identifier, which begins with the signature vhdxfile and the name of the
program that made it. Two copies of the header follow, at 64 KB and 128 KB, each starting
head and carrying a sequence number, so that the newer valid copy wins. Two
copies of the region table, at 192 KB and 256 KB, start regi and give the
position of the block allocation table and of the metadata region.
The metadata region holds the disk’s settings: its virtual size, block size, sector sizes and, for a differencing disk, the location of the parent. The block allocation table (BAT) maps each block of the virtual disk, between 1 MB and 256 MB in size, to its place in the file. The log records changes to these structures before they are made.
0File type identifiervhdxfileand the creator’s name64 KB0x10000Header 1head, sequence number, log position64 KB0x20000Header 2 the second copy64 KB0x30000Region table 1regi, where the BAT and metadata are64 KB0x40000Region table 2 the second copy64 KB…Log, BAT, metadata and data blocksvaries
Links
Software
- Hyper-V, built into Windows and Windows Server
- Windows Disk Management, which creates VHDX files and attaches them as drives
- QEMU and qemu-img, which run and convert VHDX files (Windows, macOS, Linux)
Developers
- libguestfs, C library and tools for reading and changing the files inside disk images