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 …”
With version 4.0.4, use “sethduuid” instead of “setvdiuuid.”
Its Working fine.
Thanks a Lotttttttt
thanks a lot fot that good description!
Extreme big hug thank u !!!
the manual really sucks and u give it like a glance :d
Thanks!!
Thanks for sharing, this helped for sure!
Genius! What a life saver! Many Thanks
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!
Adam –
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 !
Good answer
Its works great ! Thx
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.
Vito –
Check out @thegeekprophet’s reply with the reminder to update the UUID in the .vbox file. Let us know if that works!
If it still complains, dont forget to update the UUID in the .vbox file for the drives you updated…
Thanks for posting this, worked perfectly for me! I needed to transfer a VBOX hard drive image to a different drive to save space which ought to be a common/easy function in VirtualBox, but isn’t. I copied the file and then changed the UUID with the command you posted. If you’re in Linux (Ubuntu, in my case), this is the command you’ll want to use:
vboxmanage internalcommands sethduuid pathto.vdi
Thanks a lot , saves me a headache 😉
Thanks man.. it worked perfectly..!!
Thanks Thousands
for version 4.2.18 what should i use instead of setvdiuuid and sethduuid
Thanks.! It worked with “VirtualBox 4.2.18”
BIG thanks for easy fix to super frustrating problem.. MAN that was one whiny moron of a hurdle…
Hey I’m trying to use this with a vhd file and I’m getting invalid UUid parameter….does this work with vhd files? I see you guys are using a vdi file…please help
Henry
thanks a lot!
Very useful info. Thanks a lot.
Very thanks, it do helpful !
Solved my same problem on virualbox : )
Muchísimas gracias, me ayudó (;
Yo tengo la versión 4.3.6 y me sirvió con sethduuid
Was trying to move a hard drive file and ran into this issue. Thanks for the information. Worked like a charm.
thx, worked fine also under mac with virtualBox 4.3.14
VirtualBox.app/Contents/MacOS/VboxManage internalcommands sethduuid /Volumes/…File.vdi
Thank you. It works 🙂
Thanks… That worked for me !!
Nice work.
thank you!
Thanks! This worked! This figuratively saved my @$$!!!