Skip to content

VDI (.vdi)

.vdi file signature | application/octet-stream

VirtualBoxVirtual Hard Disk file format

Safe

Magic Bytes

Offset 0
3C 3C 3C 20 4F 72 61 63 6C 65 20 56 4D 20 56 69 72 74 75 61 6C 42 6F 78 20 44 69 73 6B 20 49 6D 61 67 65 20 3E 3E 3E

Sources: Wikipedia

Extension

.vdi

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .vdi files in Python

Python
def is_vdi(file_path: str) -> bool:
    """Check if file is a valid VDI by magic bytes."""
    signature = bytes([0x3C, 0x3C, 0x3C, 0x20, 0x4F, 0x72, 0x61, 0x63, 0x6C, 0x65, 0x20, 0x56, 0x4D, 0x20, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x42, 0x6F, 0x78, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3E, 0x3E, 0x3E])
    with open(file_path, "rb") as f:
        return f.read(39) == signature

How to validate .vdi files in Node.js

Node.js
function isVDI(buffer: Buffer): boolean {
  const signature = Buffer.from([0x3C, 0x3C, 0x3C, 0x20, 0x4F, 0x72, 0x61, 0x63, 0x6C, 0x65, 0x20, 0x56, 0x4D, 0x20, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x42, 0x6F, 0x78, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3E, 0x3E, 0x3E]);
  return buffer.subarray(0, 39).equals(signature);
}

How to validate .vdi files in Go

Go
func IsVDI(data []byte) bool {
    signature := []byte{0x3C, 0x3C, 0x3C, 0x20, 0x4F, 0x72, 0x61, 0x63, 0x6C, 0x65, 0x20, 0x56, 0x4D, 0x20, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6C, 0x42, 0x6F, 0x78, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3E, 0x3E, 0x3E}
    if len(data) < 39 {
        return false
    }
    return bytes.Equal(data[:39], signature)
}

API Endpoint

GET /api/v1/vdi
curl https://filesignature.org/api/v1/vdi

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .vdi file?

A .vdi file is a VDI file. VirtualBoxVirtual Hard Disk file format

What are the magic bytes for .vdi files?

The magic bytes for VDI files are 3C 3C 3C 20 4F 72 61 63 6C 65 20 56 4D 20 56 69 72 74 75 61 6C 42 6F 78 20 44 69 73 6B 20 49 6D 61 67 65 20 3E 3E 3E at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .vdi file?

To validate a .vdi file, read the first bytes of the file and compare them against the known magic bytes (3C 3C 3C 20 4F 72 61 63 6C 65 20 56 4D 20 56 69 72 74 75 61 6C 42 6F 78 20 44 69 73 6B 20 49 6D 61 67 65 20 3E 3E 3E) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .vdi files?

There is no officially registered MIME type for .vdi files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .vdi files?

VDI (.vdi) 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.