5 Virtual storage Note: As a special exception, immutable images are not reset if they are attached to a machine whose last snapshot was taken while the machine was running (a so-called “online” snapshot). As a result, if the machine’s current snapshot is such an “online” snapshot, its immutable images behave exactly like the “normal” images described pre- viously. To re-enable the automatic resetting of such images, delete the current snap- shot of the machine. Again, technically, VirtualBox never writes to an immutable image directly at all. All write operations from the machine will be directed to a differencing image the next time the VM is powered on, the differencing image is reset so that every time the VM starts, its im- mutable images have exactly the same content.7 The differencing image is only reset when the machine is powered on from within VirtualBox, not when you reboot by requesting a reboot from within the machine. This is also why immutable images behave as described above when snapshots are also present, which use differencing images as well. If the automatic discarding of the differencing image on VM startup does not fit your needs, you can turn it off using the autoreset parameter of VBoxManage modifyhd see chapter 8.21, VBoxManage modifyhd, page 123 for details. 5. An image in multiattach mode can be attached to more than one virtual machine at the same time, even if these machines are running simultaneously. For each virtual machine to which such an image is attached, a differencing image is created. As a result, data that is written to such a virtual disk by one machine is not seen by the other machines to which the image is attached each machine creates its own write history of the multiattach image. Technically, a “multiattach” image behaves identically to an “immutable” image except the differencing image is not reset every time the machine starts. 6. Finally, the read-only image is used automatically for CD/DVD images, since CDs/DVDs can never be written to. To illustrate the differences between the various types with respect to snapshots: Assume you have installed your guest operating system in your VM, and you have taken a snapshot. Imagine you have accidentally infected your VM with a virus and would like to go back to the snapshot. With a normal hard disk image, you simply restore the snapshot, and the earlier state of your hard disk image will be restored as well (and your virus infection will be undone). With an immutable hard disk, all it takes is to shut down and power on your VM, and the virus infection will be discarded. With a write-through image however, you cannot easily undo the virus infection by means of virtualization, but will have to disinfect your virtual machine like a real computer. Still, you might find write-through images useful if you want to preserve critical data irrespec- tive of snapshots, and since you can attach more than one image to a VM, you may want to have one immutable for the operating system and one write-through for your data files. 5.5 Differencing images The previous section hinted at differencing images and how they are used with snapshots, im- mutable images and multiple disk attachments. For the inquisitive VirtualBox user, this section describes in more detail how they work. A differencing image is a special disk image that only holds the differences to another image. A differencing image by itself is useless, it must always refer to another image. The differencing image is then typically referred to as a “child”, which holds the differences to its “parent”. 7This behavior also changed with VirtualBox 2.2. Previously, the differencing images were discarded when the machine session ended now they are discarded every time the machine is powered on. 77
Previous Page Next Page