15-09-2013, 07:00 PM
How to convert virtual hard drive files VDI, VMDK, VHD and RAW using VBoxManage
I was trying to get an old virtual machine up and running again for testing and for some reason thought converting from a .vdi to .vhd would help.
I already had virtual box installed which means I already had the VBoxManage program.
Open a command prompt
Check VBoxManage syntax.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" /?
The bit we're interested in
clonehd <uuid|inputfile> <uuid|outputfile>
[--format VDI|VMDK|VHD|RAW|<other>]
[--variant Standard,Fixed,Split2G,Stream,ESX]
[--existing]
What I used
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd "E:\Virtual Machines\VirtualBox\XP-Spiceworks\XP-Spiceworks.vdi" "E:\Virtual Machines\VirtualBox\XP-Spiceworks\XP-Spiceworks.vhd" --format VHD
Only took a few minutes to convert it
Files sizes
XP-Spiceworks.vdi 11,811,205,632
XP-Spiceworks.vhd 9,710,111,232