02 March 2016

VirtualBox – Cannot Register the Hard Drive Because a Hard Drive with UUID Already Exists

I was trying to attach an existing .vdi hard disk and I got this error:

Failed to open the disk image file C:\Users\Boso\.VirtualBox\HardDisks\WinXP EEE Light.vdi.

Cannot register the hard disk 'C:\Users\Boso\.VirtualBox\HardDisks\WinXP EEE Light.vdi' {9ef5aad7-a03c-479c-a583-8c017acc144c} because a hard disk 'C:\Users\francesco.bosetti\.VirtualBox\HardDisks\WinXP EEE Light.vdi' with UUID {9ef5aad7-a03c-479c-a583-8c017acc144c} already exists.

Result Code: E_INVALIDARG (0x80070057)
Component: VirtualBoxWrap
Interface: IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

The solution is to run this command:
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands sethduuid "C:\Users\Boso\.VirtualBox\HardDisks\WinXP EEE Light.vdi"
UUID changed to: 3b27ce3e-6f95-4873-9561-5d4e28ea8f50

Note that internalcommands and sethduuid need to be lowercase!


Works on VirtualBox v5.0.14

Found here.