Converting a VirtualBox VDI image to real HD image

I’m using a small Slitaz distro to create a game machine, it is working fine, now I need to convert the dynamic hard disc VDI image to real raw disc image.

First I tried this command:

$ VBoxManage clonehd Slitaz.vdi /tmp/slitaz_hd.img --format RAW
VBoxManage: error: Cannot register the hard disk '/home/alan/VirtualBox VMs/Slitaz_user/Slitaz.vdi' {e5727c28-c490-49f7-8b23-xxxxxxxxxxxx} because a hard disk '/home/alan/VirtualBox VMs/Slitaz/Slitaz.vdi' with UUID {e5727c28-c490-49f7-8b23-xxxxxxxxxxxx} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp

Because I’m using dynamic disc the above command didn’t work.

Now let to try other alternative:

$ VBoxManage internalcommands converttoraw Slitaz.vdi /tmp/slitaz_hd.img
Converting image "Slitaz.vdi" with size 4294967296 bytes (4096MB) to raw...

Great! Worked as expected:

$ ls -l /tmp/slitaz_hd.img
-rw------- 1 alan alan 4294967296 Mar 18 12:03 /tmp/slitaz_hd.img


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s