What is the VHD file format?
A .vhd file contains a virtual image of a hard drive, used by virtualization platforms such as Microsoft Hyper-V, Oracle VirtualBox and Windows Virtual PC. A single .vhd file may contain all the data stored on a physical hard drive, saved in the same structure - partitions, system files, regular files and folders.
Possibilities resulting from .vhd files
.vhd files are typically used as virtual machine disks, which makes it possible to install and run multiple operating systems without needing several physical drives or separate computers. This enables many possibilities - for example, maintaining programs and applications in different environments. .vhd files also enable restoring chosen directories or a whole hard drive. On Windows 7 and later, a .vhd can be mounted directly through Disk Management or with the Mount-DiskImage PowerShell cmdlet, without any third-party software.
Brief history of the VHD format
The VHD format was created by Connectix, a company acquired by Microsoft in 2003, which then developed the Microsoft Virtual PC product. Microsoft subsequently published the VHD specification under its Open Specification Promise, making the format royalty-free to implement. In 2012 significant upgrades were introduced as a new format - .VHDX - which supports larger disks (up to 64 TB) and improves resilience against corruption.
Types of VHD files
.vhd files can be identified in several types, which facilitates managing them:
- Fixed hard disk image - has a fixed size equal to the size of the virtual drive; all storage is allocated at creation time.
- Dynamic hard disk image - the file size starts small and grows as data is written; it contains only the sectors that have actually been used.
- Differencing disk image - a separate
.vhdthat records only changes relative to a parent (base) disk; Hyper-V uses the related .AVHD extension for VM checkpoint files. - Linked (pass-through) - contains only a link to a physical drive, granting the virtual machine direct hardware access.
Competing virtualization disk formats include .VMDK (VMware) and .VDI (VirtualBox native). The qemu-img tool can convert between all of these formats on Linux and macOS.
Security & safety
RISK: MEDIUMA .vhd is a disk image, not directly executable on the host - but it can contain a full bootable OS, so a downloaded VHD may harbour malware inside the guest. Run untrusted VMs isolated (no shared folders, limited networking). Mounting a VHD via Disk Management exposes its filesystem to the host, so scan unknown images before opening files. VHDs also hold whatever sensitive data the guest had (credentials, personal files) - handle as confidential. They are large; ensure free space before converting/copying.
Format details
in a nutshellPrograms that open VHD files
Technical details
deep spec| Container type | Binary virtual hard-disk container - raw disk image with a 512-byte footer appended at the end of the file |
| Footer cookie (magic bytes) | ASCII string `conectix` (8 bytes) at the start of the 512-byte footer; at EOF for fixed VHDs, and additionally at byte offset 0 for dynamic and differencing VHDs |
| Footer size | 512 bytes; a second copy is placed at byte 0 in dynamic and differencing VHD files, where it serves as the file header |
| Maximum virtual disk size | ~2040 GB (~2 TB), limited by 32-bit geometry fields in the VHD footer |
| MIME type | application/x-vhd |
| Supported disk image types | Fixed (pre-allocated), Dynamic (sparse, grows on write), Differencing (child disk recording deltas against a parent), Pass-through (reference to a physical drive) |
| Dynamic block size | Default 2 MB per block; each block has an associated sector bitmap tracking which 512-byte sectors within it have been written |
| Footer byte order | Big-endian (network byte order) for all multi-byte footer fields, including size, geometry and timestamps |
| Integrity verification | CRC-32 checksum embedded in both the 512-byte footer and the dynamic disk header |
| Disk geometry encoding | Cylinder-Head-Sector (CHS) values stored in the footer for BIOS-compatible booting |
| Native Windows mount | Mountable on Windows 7 and later without third-party tools - via Disk Management, `diskpart attach vdisk`, or the `Mount-DiskImage` PowerShell cmdlet |
| Successor format | Superseded by `.vhdx`, which supports up to 64 TB virtual disks and adds metadata journaling for crash resilience |
| Sector size emulated | 512 bytes (traditional HDD geometry), regardless of the host drive's physical sector size |
| Parent locator entries | Differencing VHDs store up to 8 parent locator entries, supporting flexible path resolution across platforms |
| License model | Published under Microsoft's Open Specification Promise, permitting royalty-free implementation by third parties |
| Released | Connectix Virtual PC (early 2000s); Microsoft published the VHD spec under its Open Specification Promise in 2006 |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |