My Technical Blog - Minoria de Uno Solo

My notes on software programming and other IT areas. It emerges as a way to collect small notes that have been useful at some point.

VirtualBox - Change UUID of Virtual Disk (.VDI)

Long answer:

Sometimes I have needed to clone a machine to save me from installing the operating system from scratch. What I usually do is copy the .vdi (the hard disk) of the old machine and give it another name to link it to the new machine. So far, so good. The problem comes when I try to link it to the new machine, that if it is running on the same host machine, it will tell us (and rightly so):

"Cannot register the hard disk 'xxxxxx.vdi' {yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy} because a hard disk 'ruta\a\tu\imagen.vdi' with UUID {yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy} already exists"


The solution would be to force the change of the UUID to the new image:


c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands sethduuid "path\to\image.vdi"


vboxmanage internalcommands sethduuid "path/to/image.vdi"

And the output of the command will be a kind of:

UUID changed to: 0b795923-74f3-4791-7ab0-a3052b727542


My Technical Blog - Minoria de Uno Solo (2020)