5Virtual storage

Finally, VirtualBox also fully supports the VHD format used by Microsoft.

Irrespective of the disk format, as briefly mentioned in chapter 3.2, Creating a virtual machine, page 32, there are two options of how to create a disk image: fixed-size or dynamically expanding.

If you create a fixed-size image of e.g. 10 GB, an image file of roughly the same size will be created on your host system. 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 re- sources, 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 Configuring image write operations

For either of the above image formats (VDI, VMDK or VHD and irrespective of whether an image is fixed-size or dynamically expanding), you can also specify how write op- erations from the VM should affect the image:

1.With normal images (the default setting), there are no restrictions on how guests can read from and write to the disk.

When you take a snapshot of your virtual machine as described in chapter 3.4.4, Snapshots, page 42, the state of such a “normal hard disk” will be recorded together with the snapshot, and when reverting to the snapshot, its state will be fully reset.

While you can attach the same “normal” image to more than one virtual ma- chine, only one of these virtual machines attached to the same image file can be executed simultaneously, as otherwise there would be conflicts if several ma- chines write to the same image file.3

2.By contrast, immutable images only remember write accesses temporarily while the virtual machine is running; all changes are lost when the virtual machine is closed.

Technically, VirtualBox never writes to an immutable image directly at all. All write operations from the VM will be directed to a special differencing disk image

3This restriction is more lenient now than it was before VirtualBox 2.2. Previously, each “normal” disk image could only be attached to one single machine. Now it can be attached to more than one machine so long as only one of these machines is running.

78

Page 78
Image 78
Sun Microsystems 3.0.0 user manual Configuring image write operations