8 VBoxManage reference

In addition, the modifyhd --compact command can be used to compact disk im- ages, i.e. remove blocks that only contains zeroes. For this operation to be effective, it is required to zero out free space in the guest system using a suitable software tool. Microsoft provides the sdelete tool for Windows guests. Execute sdelete -c in the guest to zero the free disk space before compressing the virtual disk image. Com- paction works both for base images and for diff images created as part of a snapshot.

8.17 VBoxManage clonehd

This command duplicates a registered virtual hard disk image to a new image file with a new unique identifier (UUID). The new image can be transferred to another host system or imported into VirtualBox again using the Virtual Disk Manager; see chapter 5.3, The Virtual Media Manager, page 80 and chapter 5.6, Cloning disk images, page

85. The syntax is as follows:

VBoxManage clonehd

<uuid><filename> <outputfile>

 

[--format VDIVMDKVHDRAW<other>]

 

[--variant Standard,Fixed,Split2G,Stream,ESX]

 

[--type normalwritethroughimmutable]

 

[--remember]

where the parameters mean:

format Allow to choose a file format for the output file different from the file format of the input file.

variant Allow to choose a file format variant for the output file. It is a comma- separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message.

type Only honored if –remember is also specified. Defines what kind of hard disk type this image should be.

remember Keep the destination image registered after it was successfully written.

Note: For compatibility with earlier versions of VirtualBox, the “clonevdi” command is also supported and mapped internally to the “clonehd” com- mand.

8.18 VBoxManage convertfromraw

This command converts a raw disk image to a VirtualBox Disk Image (VDI) file. The syntax is as follows:

127

Page 127
Image 127
Sun Microsystems VERSION 3.1.0_BETA2 user manual VBoxManage clonehd, VBoxManage convertfromraw