Change UUID of VirtualBox vdi


Looking for quick way to reuse a vdi I preped with Windows XP SP3 and recent updates, I decided to duplicate the vdi with Windows Explorer. Of course, this was too simple. After attempting to create a new virtual machine which used the newly created vdi, I was presented with a nasty error along the lines of  ”Failed to open the hard disk ….” and “Cannot register the hard disk C:\path\to\new\vdi with UUID {xxxx} because a hard disk C:\path\to\old\vdi already exists in the media registry (C:\path to VirtualBox.xml)
VirtualBox UUID Error
Luckily there is a simple fix for this…
Lauch a command prompt and browse to where VBoxManager.exe is located (for me this is C:\Program Files\Oracle\VirtualBox) and run the comand below
VBoxManage.exe internalcommands setvdiuuid "C:\path\to\new\vdi"
NOTE: the command has been changed to sethduuid in version 4.0.4 (thanks Isaac!). So the commad in 4.0.4 would be…
VBoxManage.exe internalcommands sethduuid "C:\path\to\new\vdi"
Which should return something similar to “UUID Changed to …”
Change UUID with VBoxManager

Mudik Lebaran 1439H 2018