Disk image files
In VirtualBox, guest VMs accesses virtual disk images that are stored on the physical hard disk in the host computer. When a guest VM tries to access these disk images, the read/write disk access is redirected by VirtualBox to the virtual disk image. A virtual disk image is similar to a physical hard disk. It has size that is basically specified when you create the VM. Upon creation, the entire size of the virtual disk might be used for the image or the image might be dynamically expanded. These two types refer to thick and thin provisioning.
Four types of disk images are supported by VirtualBox:
- VDI – also known as Virtual Disk Image.
- VMDK – the VMware format of a virtual hard disk.
- VHD – the Microsoft format of a virtual hard disk.
- HDD – the image file of Parallels Version 2 format.
You can create two kinds of disk images: fixed size images or dynamically allocated images:
- Dynamically allocated hard drive – the disk image will be created with a minimal size, but it grows automatically when more space is needed by the guest operating system. However, during the creation of a dynamically expanding disk, you specify a maximum capacity, which is the maximum capacity the disk will expand to. The main advantage of using this feature is that you are not wasting the disk space on the host before it is required, but there is a disadvantage associated with it in that it results in a slow performance if disk expansion happens pretty frequently.
- Fixed size hard drive – a disk image file is created with the specified size. This option improves the write performance, but the disadvantage is that it will take a long time to create the disk image in the first place and you might end up wasting the disk space if it’s not required.