# VirtualBox Disk Image

> file format

**Wikidata**: [Q29209126](https://www.wikidata.org/wiki/Q29209126)  
**Source**: https://4ort.xyz/entity/virtualbox-disk-image

## Summary
A VirtualBox Disk Image (VDI) is a specialized file format that serves as a disk image, containing the complete contents and structure of a computer disk volume. It is the native format used by VirtualBox virtualization software to store virtual hard drives, typically identified by the .vdi file extension.

## Key Facts
- Classified as a disk image, which is a computer file containing the structure of a disk volume.
- Uses the file extension .vdi and is commonly referred to by the alias "vdi."
- Employs little endian byte ordering for its data structure.
- Features a specific file format identification pattern (magic number) of `3C3C3C20` in hexadecimal at the beginning of the file.
- Associated with unofficial media types including `application/x-virtualbox-vdi` and `application/x-vdi-disk`.
- Technical specifications and community documentation are primarily hosted on the VirtualBox forums.

## FAQs
### Q: What is the primary purpose of a .vdi file?
A: A .vdi file is a VirtualBox Disk Image used to represent a virtual hard disk. It stores the operating system, applications, and data of a virtual machine in a single file that mimics the structure of a physical disk volume.

### Q: How can a VirtualBox Disk Image be identified at a technical level?
A: The format can be identified by a hexadecimal pattern `3C3C3C20` located at the very beginning of the file (offset 0). This signature allows software to recognize the file as a VirtualBox Disk Image.

### Q: What byte ordering does the VDI format use?
A: The VirtualBox Disk Image format uses little endian endianness. This is a standard technical specification for how data is ordered within the file's structure.

## Why It Matters
The VirtualBox Disk Image (VDI) is a critical component in the field of virtualization, providing a standardized way to encapsulate entire computing environments. As a disk image, it allows for the isolation of software and operating systems from the physical hardware of a host computer. This encapsulation is vital for developers, system administrators, and researchers who need to test software across different platforms or maintain legacy systems without dedicated hardware.

The VDI format's reliance on little endian architecture and specific identification patterns ensures that virtualization software can reliably mount and manage virtual storage. While there are multiple disk image formats available, the VDI is the native choice for the VirtualBox ecosystem, offering a balance of structure and compatibility. By using unofficial but recognized media types like `application/x-virtualbox-vdi`, the format integrates with various operating systems' file management tools. Ultimately, the VDI format enables the portability of entire workstations, allowing a user to move a complete virtual hard drive between different physical machines while preserving the exact state of the digital volume.

## Notable For
- **Native VirtualBox Integration:** Serves as the primary, native disk image format for the VirtualBox virtualization platform.
- **Unique Identification Signature:** Distinguished by the specific hexadecimal "magic number" `3C3C3C20` at the start of the file.
- **Standardized Endianness:** Strictly adheres to little endian byte ordering for consistent data interpretation.
- **Broad Recognition:** Included in major file identification databases such as TrID and the shared-mime-info database.

## Body

### Technical Architecture
The VirtualBox Disk Image is an instance of the disk image class. It functions as a digital container for the contents and structure of a disk volume. Technically, the format is defined by its little endian byte order, which dictates how multi-byte data is stored and read by the virtualization engine.

### Identification and Metadata
VDI files are primarily identified by the file extension .vdi. At the binary level, the format uses a specific identification pattern to distinguish itself from other disk image formats:
*   **Pattern:** `3C3C3C20` (Hexadecimal)
*   **Location:** Beginning of the file (offset 0)

The format is associated with two unofficial MIME types used for system-level file identification:
1.  `application/x-virtualbox-vdi`
2.  `application/x-vdi-disk`

### Documentation and Standards
Technical details regarding the VDI format are documented through community and academic sources. Key references include the VirtualBox forums and the shared-mime-info project maintained by freedesktop.org. These resources provide the specifications necessary for software to interact with the VDI structure, ensuring that the disk volume's integrity is maintained during read and write operations.

## References

1. [TrID](https://mark0.net/soft-tridscan-e.html)
2. [Source](https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/2.3/data/freedesktop.org.xml.in#L8063-8077)
3. [Source](https://forums.virtualbox.org/viewtopic.php?p=29266#p29266)