Monday 28 May 2012

Virtual Machines Duplicate VHDs

Great little trick with Virtual Machine HDs.  I like others have found it very useful to create a virtual disk and duplicate it for different things.  The problem is if you attempt to re-use a copied vhd for a new machine in VirtualBox then it causes a nice little error:

VBoxManage.exe: error: Cannot register the hard disk [VHD Drive name] {[GUID]} because a hard disk  [VHD Drive name]   with UUID { [GUID]} already exists

The fantastic command to sort out this little problem is "VBoxManage internalcommands sethduuid" e.g:


C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands sethduuid "Z:\TestMachine1\HardDisk.vdi"

Which should result in something like:

UUID changed to: c9f4029b-8782-4348-82f3-0d2243ead38c


Thanks to the helpful individuals on these sites which give more examples:
http://michail.flouris.net/2011/11/virtualbox-vm-disk-clone-uuid-problem/
https://forums.virtualbox.org/viewtopic.php?p=33678