Convert a raw disk image to a virtual disk image.
The VBoxManage convertfromraw command enables you to convert a raw disk image to an Oracle VM VirtualBox virtual disk image (VDI).
For compatibility with earlier versions of Oracle VM VirtualBox, you can use the VBoxManage convertdd command instead of the VBoxManage convertfromraw command.
VBoxManage convertfromraw <inputfile> <outputfile> [--format= VDI | VMDK | VHD ] [--uuid=uuid] [--variant=Standard,Fixed,Split2G,Stream,ESX]
The VBoxManage convertfromraw command converts the specified raw disk image input file to an Oracle VM VirtualBox VDI file.
inputfile
Specifies the name of the raw disk image file to convert.
outputfile
Specifies the name of the file in which to write the VDI output.
--format=VDI | VMDK | VHD
Specifies the format of the disk image to create. Valid
values are VDI,
VMDK, and VHD. The
default format is VDI.
--uuid=uuid
Specifies the Universally Unique Identifier (UUID) of the output file.
--variant=Standard,Fixed,Split2G,Stream,ESX
Specifies any required file format variants for the output file. This is a comma-separated list of variant values. Following are the valid values:
Standard is the default disk image
type, which has a dynamically allocated file size.
Fixed uses a disk image that has a
fixed file size.
Split2G indicates that the disk
image is split into 2GB segments. This value is for
VMDK only.
Stream optimizes the disk image for
downloading. This value is for VMDK only.
ESX is used for some VMWare
products. This value is for VMDK only.
Note that not all variant combinations are valid. Specifying incompatible variant values in the list will produce an error message.
VBoxManage convertfromraw stdin <outputfile> <bytes> [--format= VDI | VMDK | VHD ] [--uuid=uuid] [--variant=Standard,Fixed,Split2G,Stream,ESX]
The VBoxManage convertfromraw stdin command reads the content of the disk image from standard input. Consider using this form of the command in a pipe sequence.
outputfile
Specifies the name of the file in which to write the disk image output.
bytes
Specifies the capacity of the targe image name. Needs to be given explicitly, because generally pipes do not support querying the overall size of the data stream.
--format=VDI | VMDK | VHD
Specifies the format of the disk image to create. Valid
values are VDI,
VMDK, and VHD. The
default format is VDI.
--uuid=uuid
Specifies the UUID of the output file.
--variant=Standard,Fixed,Split2G,Stream,ESX
Specifies any required file format variants for the output file. This is a comma-separated list of variant values. Following are the valid values:
Standard is the default disk image
type, which has a dynamically allocated file size.
Fixed uses a disk image that has a
fixed file size.
Split2G indicates that the disk
image is split into 2GB segments. This value is for
VMDK only.
Stream optimizes the disk image for
downloading. This value is for VMDK only.
ESX is used for some VMWare
products. This value is for VMDK only.
Note that not all variant combinations are valid. Specifying incompatible variant values in the list will produce an error message.
The following command converts the raw disk image input file
disk01.raw. The output file is a VDI disk
image called disk02.vdi.
$ VBoxManage convertfromraw disk01.raw disk02.vdi
The following command converts the raw disk image input file
disk01.raw. The output file is a VMDK disk
image called disk02.vmdk.
$ VBoxManage convertfromraw disk01.raw disk02.vmdk --format VMDK
The following command reads from disk /dev/sda
using a pipe and therefore needs the exact disk size in bytes as an
additional parameter, which is assumed to be 10737418240.
The output file is a VDI disk image called disk.vdi.
$ dd if=/dev/sda bs=512 | VBoxManage convertfromraw stdin disk.vdi 10737418240