VHDX (.vhdx)
.vhdx file signature | application/octet-stream
Virtual Hard Disk v2 (VHDX) is a virtual disk image format created by Microsoft and used in Windows virtualization environments. It is primarily used by Hyper-V and other compatible tools to store the contents of virtual machine disks, including operating systems, applications, and data. It is not a legacy format; while generally safe, VHDX files can contain malicious content if obtained from untrusted sources and should be mounted with care.
Magic Bytes
Offset 0
76 68 64 78 66 69 6C 65
Sources: Wikipedia
Extension
.vhdx
MIME Type
application/octet-stream
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .vhdx files in Python
def is_vhdx(file_path: str) -> bool:
"""Check if file is a valid VHDX by magic bytes."""
signature = bytes([0x76, 0x68, 0x64, 0x78, 0x66, 0x69, 0x6C, 0x65])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .vhdx files in Node.js
function isVHDX(buffer: Buffer): boolean {
const signature = Buffer.from([0x76, 0x68, 0x64, 0x78, 0x66, 0x69, 0x6C, 0x65]);
return buffer.subarray(0, 8).equals(signature);
}
How to validate .vhdx files in Go
func IsVHDX(data []byte) bool {
signature := []byte{0x76, 0x68, 0x64, 0x78, 0x66, 0x69, 0x6C, 0x65}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
/api/v1/vhdx
curl https://filesignature.org/api/v1/vhdx
See the full API documentation for all endpoints and parameters.
Related Formats
Frequently Asked Questions
What is a .vhdx file?
A .vhdx file is identified by the magic bytes 76 68 64 78 66 69 6C 65 at byte offset 0. Virtual Hard Disk v2 (VHDX) is a virtual disk image format created by Microsoft and used in Windows virtualization environments. It is primarily used by Hyper-V and other compatible tools to store the contents of virtual machine disks, including operating systems, applications, and data. It is not a legacy format; while generally safe, VHDX files can contain malicious content if obtained from untrusted sources and should be mounted with care.
What are the magic bytes for .vhdx files?
The magic bytes for VHDX files are 76 68 64 78 66 69 6C 65 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .vhdx file?
To validate a .vhdx file, read the first bytes of the file and compare them against the known magic bytes (76 68 64 78 66 69 6C 65) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .vhdx files?
There is no officially registered MIME type for .vhdx files. Systems typically use application/octet-stream as a generic fallback when handling this format.
Is it safe to open .vhdx files?
VHDX (.vhdx) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.