beautypg.com

Sun Microsystems VIRTUALBOX VERSION 3.1.0_BETA2 User Manual

Page 82

background image

5 Virtual storage

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.

5

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
restarted. As a result, as opposed to “normal” images, the same immutable image
can be used with several virtual machines without restrictions.

(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 started, the differencing image is reset so that
every time the VM starts, its immutable images have exactly the same content.

6

)

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.16

,

VBoxManage modifyhd

, page

126

for details.

With respect to snapshots, the behavior of immutable images is identical to that
of “normal” images. When reverting to a snapshot taken of an immutable image,
its state will be fully reset to that of the snapshot.

Creating

an immutable image makes little sense since it would be initially empty

and lose its contents with every machine restart (unless you really want to have
a disk that is always unformatted when the machine starts up). As a result,
normally, you would first create a “normal” image and then, when you deem its
contents useful, later mark it immutable using VBoxManage modifyhd; again,
please see chapter

8.16

,

VBoxManage modifyhd

, page

126

. Alternatively, open

an existing image in “immutable” mode using VBoxManage openmedium; see
chapter

8.12

,

VBoxManage openmedium / closemedium

, page

123

.

3. Finally, write-through hard disks are like normal hard disks in that they fully

support read and write operations. However, such images are completely unaf-
fected by snapshots: their state is not saved when a snapshot is taken, and not
restored when a snapshot is restored.

To create a disk image in VDI format as “write-through”, use the VBoxManage
createhd

command; see chapter

8.15

,

VBoxManage createhd

, page

125

. To

mark an existing image as write-through, use VBoxManage modifyhd; see
chapter

8.16

,

VBoxManage modifyhd

, page

126

.

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

5

This 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.

6

This behavior also changed with VirtualBox 2.2. Previously, the differencing images were discarded when

the VM session ended; now they are discarded every time the VM starts.

82