Changes

Jump to: navigation, search
Normal, Immutable and Write-Through Disk Images
== Normal, Immutable and Write-Through Disk Images ==
 
In addition to the option to make a virtual disk image size fixed or dynamic, three additional options are available in the form of ''immutable'', ''normal'' and ''write-through'' settings, each of which is associated with the way in which data is written to the disk drive:
 
* '''Normal''' - This is the default setting for newly created disk images. Any data read or write operations performed on the disk image by the guest operating system are performed on the disk image itself. As such, a normal disk may only be associated with one running virtual machine at any one time. In addition, any changes to the data on the disk are remain after the guest system is powered off.
 
* '''Immutable''' - When a virtual disk image is configured as immutable, the contents of the disk are read-only. Any data written by a guest operating system to an immutable disk are stored in a separate ''differencing'' disk image. When the virtual machine to which the disk image is powered of reset, the differencing disk and the contents therein are discarded, leaving the immutable disk unaltered. This approach allows multiple virtual machines to share the same disk image file, each being assigned its own differencing disk during run time.
 
* '''Write-through''' - Write-through disk images allow read and write operations to be performed on the disk image. When the virtual machine is powered off or reset, however, the state of the disk image is not saved, thereby reverting to its original state next time the virtual machine starts.
 
To convert an existing virtual disk image to immutable or write-through type it must first be detached from any virtual machines. This can achieved by selecting the virtual machine to which the disk is attached from the VirtualBox management interface and clicking on the ''File->Virtual Media Manager'' menu option. In the Media Manager dialog, select the disk to be modified and click on the ''Release'' toolbar button.
 
Before changing the type of a virtual disk image, it is often useful to find out the current configuration settings. This can be achieved using VBoxManage command as follows:
 
<pre>
C:\Program Files\Sun\xVM VirtualBox>VBoxmanage showhdinfo Ubuntu.vdi
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
 
UUID: 22ccb1e6-5b5f-4343-8788-f90ab19203a6
Accessible: yes
Logical size: 11100 MBytes
Current size on disk: 4397 MBytes
Type: normal
Storage format: VDI
Location: C:\Users\nas\.VirtualBox\HardDisks\Ubuntu.vdi
</pre>
 
Once the disk has been released from any virtual machines, use the ''VBoxManage'' command as follows to change the type to ''immutable'':
 
<pre>
VBoxmanage modifyhd <disk image>.vdi settype immutable
 
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
</pre>
 
where ''<disk image> is the name of the image file to be modified.
 
A disk image may similarly be converted to ''write-through'' as follows:
 
<pre>
VBoxmanage modifyhd <disk image>.vdi settype writethrough
 
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
</pre>
 
To convert an immutable or writethrough disk back to the normal type:
 
<pre>
VBoxmanage modifyhd <disk image>.vdi settype normal
 
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
</pre>
 
Once the disk image type conversion is complete, re-attach the disk image to the virtual machine to which it belongs using the ''Settings'' screen in the VirtualBox GUI management interface.
== Support for Third Party Disk Image Formats ==
1,798
edits

Navigation menu