Changes

Jump to: navigation, search
Cloning a Virtual Disk Image
== Cloning a Virtual Disk Image ==
Virtual disk images may be cloned for use in other virtual machines using the VBoxManage command. If the This technique also works well for converting virtual disk image images from one format to another. The syntax for the command is in a as follows: :<tt>VBoxManage clonehd ''<source image file>'' ''<target image file>'' -format other than VirtualBox VDI ''<format>''</tt> where ''<source image file>'' is the virtual disk image file to be converted, ''<target image file>'' is the format should name to be specified when performing used for the clone operationcloned image and ''format'' is the target format of the virtual disk image (RAW, VDI, VMDK or VHD).  For example, to clone a VDI disk image named Ubuntu.vdi, naming the clone Ubuntu2.vdi, the following command is executed:
<pre>
vboxmanage VBoxManage clonehd Ubuntu.vdi Ubuntu2.vdi -format VDI
VirtualBox Command Line Management Interface Version 2.1.4
Once the cloning process is complete (the exact duration of the process depends on the size of the original virtual disk), the cloned image will need to be added to the VirtualBox virtual media inventory using the Virtual Media Manager so that it is available for attachment to a virtual machine.
 
== Converting a RAW Disk Image to VDI Format ==
 
A raw disk image files may be converted to VDI, VHD or VMDK formats using the VBoxManage command. This is particularly useful for converting the contents of a physical disk drive or a Xen based virtual disk image to a VirtualBox disk image. The syntax for this conversion is as follows:
 
:<tt>VBoxManage convertfromraw ''[-static]'' -format ''<format>'' ''<source image file>'' ''<target image file>''</tt>
 
where the optional ''-static'' directive specifies that the converted disk is to be fixed in size (when -static is omitted the disk is created as dynamically sized), ''<format>'' represents the format to which the raw image is to converted (VDI, VMDK or VHD), '<source image file>'' is the filename of the raw image file and ''<target image file>'' is the name of the converted image file.
 
For example, the following command converts a raw image file to a VDI virtual disk:
 
<pre>
VBoxManage convertfromraw -format VDI xenvista.img xenvista.vdi
 
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
 
Converting from raw image file="xenvista.img" to file="xenvista.vdi"...
Creating dynamic image with size 10485760000 bytes (10000MB)...
</pre>
1,798
edits

Navigation menu