# 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)

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 …”

• Isaac W. March 17, 2011 at 8:57 pm

With version 4.0.4, use “sethduuid” instead of “setvdiuuid.”

• Its Working fine.
Thanks a Lotttttttt

• thanks a lot fot that good description!

• Mostafa July 1, 2011 at 1:37 am

Extreme big hug thank u !!!
the manual really sucks and u give it like a glance :d

• Amyo Rahman July 6, 2011 at 3:42 pm

Thanks!!

• Thanks for sharing, this helped for sure!

• Genius! What a life saver! Many Thanks

• Neeraj Pansari September 29, 2011 at 7:17 am

Thanks for the detailed info.
It is easy and it works fine

• Thanks, I used “sethduuid” instead of “setvdiuuid.”

• Thanks a lot! It’s helped me on 4.1.6 version, I uses “sethduuid”

• It solved my problem, thank you very much.

• Worked on a VMDK (VMWare) disk as well (that I’m using under VirtualBox). I pulled many hairs over the last few days until I found your post – thank you.

• thank you ! 终于知道解决方法了……（NOTE: the command has been changed to sethduuid in version 4.0.4 (thanks Isaac!). So the commad in 4.0.4 would be…）

• Thanks Randall. You saved me some time today!

• Thanks alot

• Thanks, you just saved me a load of time This blog-post is going in my bookmarks for sure. Like others, I used the new (sethduuid) command format, with VirtualBox 4.1.12

• When I try to run sethduuid on 4.1.14 using this command:

vboxmanage internalcommands setheuuid “E:\vm.vdi”

I get the following error:

VERR_FILE_NOT_FOUND at D:\tinderbox\win-4.1\src\VBox\Storage\VD.cpp(4484) in function VDOpen
VBoxManage.exe : error: Cannot open the image : VERR_FILE_NOT_FOUND

I have no D: drive and have nothing to do with tinderbox. Help!

• R. Kent May 7, 2012 at 2:03 pm

Can you confirm your .virtualbox file is pointing to the correct location of the vdi?

• Yes, and no reference anywhere to a D: drive.

• SOLVED – turns out vboxmanage is case sensitive when looking at path and file names.

Simple solution!

• thanks a lot !

• Arnold June 5, 2012 at 5:33 am

Its works great ! Thx

• Thodoris June 25, 2012 at 2:22 pm

thank you…. It was just driving me crazy

• Thanks a lot!
That’s so easy

• Thanks a lot! Resetting the uuid via cmd totally fixed my problem. You’re the man!!

• Thanks a lot ! My problem was solved!

• Thx a mil

• Thanks a lot!
It was really useful for me to save my time….

• Thank you very much. I knew there was a solution and it was in the back of my mind. Your link was the first entry when I searched for the solution.

I had copied a cloned image into a different location (instead of the default C: drive), which, when I tried to use, caused this error.

• I have use the command and I do not have any error but when i try to import the Virtual Machine Definiton file I obtain the same error. There is another way to solve the problem? Thanks.

• R. Kent June 18, 2013 at 4:26 pm

Vito –

Check out @thegeekprophet’s reply with the reminder to update the UUID in the .vbox file. Let us know if that works!