5 Virtual storage Like a physical disk, a virtual disk has a size (capacity), which must be specified when the image file is created. As opposed to a physical disk however, VirtualBox allows you to expand an image file after creation, even if it has data already see chapter 8.21, VBoxManage modifyhd, page 123 for details.3 VirtualBox supports four variants of disk image files: Normally, VirtualBox uses its own container format for guest hard disks Virtual Disk Image (VDI) files. In particular, this format will be used when you create a new virtual machine with a new disk. VirtualBox also fully supports the popular and open VMDK container format that is used by many other virtualization products, in particular, by VMware.4 VirtualBox also fully supports the VHD format used by Microsoft. Image files of Parallels version 2 (HDD format) are also supported.5 For lack of documen- tation of the format, newer formats (3 and 4) are not supported. You can however convert such image files to version 2 format using tools provided by Parallels. Irrespective of the disk capacity and format, as briefly mentioned in chapter 1.7, Creating your first virtual machine, page 16, there are two options of how to create a disk image: fixed-size or dynamically expanding. If you create a fixed-size image, an image file will be created on your host system which has roughly the same size as the virtual disk’s capacity. So, for a 10G disk, you will have a 10G file. Note that the creation of a fixed-size image can take a long time depending on the size of the image and the write performance of your hard disk. For more flexible storage management, use a dynamically expanding image. This will initially be very small and not occupy any space for unused virtual disk sectors, but the image file will grow every time a disk sector is written to for the first time. While this format takes less space initially, the fact that VirtualBox needs to constantly expand the image file consumes additional computing resources, so until the disk has fully expanded, write operations are slower than with fixed size disks. However, after a dynamic disk has fully expanded, the performance penalty for read and write operations is negligible. 5.3 The Virtual Media Manager VirtualBox keeps track of all the hard disk, CD/DVD-ROM and floppy disk images which are in use by virtual machines. These are often referred to as “known media” and come from two sources: all media currently attached to virtual machines “registered” media for compatibility with VirtualBox versions older than version 4.0. For details about how media registration has changed with version 4.0, please refer to chapter 10.1, Where VirtualBox stores its files, page 153. The known media can be viewed and changed in the Virtual Media Manager, which you can access from the “File” menu in the VirtualBox main window: 3Image resizing was added with VirtualBox 4.0. 4Initial support for VMDK was added with VirtualBox 1.4 since version 2.1, VirtualBox supports VMDK fully, meaning that you can create snapshots and use all the other advanced features described above for VDI images with VMDK also. 5Support was added with VirtualBox 3.1. 74
Previous Page Next Page