VirtualBox: Error: Cannot register the hard disk | Comments (33)
Posted in Code, Linux/Unix on 23rd July 2009, 10:27 am by Stuart
If when cloning VirtualBox VMs you get an error like this:
$ VBoxManage clonehd WinXP-IE7.vdi WinXP-IE8.vdi
VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
ERROR: Cannot register the hard disk '/home/scol/.VirtualBox/VDI/WinXP-IE7.vdi' with UUID {3858b1b1-c306-4505-8264-235af812f337} because a hard disk '/home/scol/.VirtualBox/VDI/WinXP-IE7.vdi' with UUID {3858b1b1-c306-4505-8264-235af812f337} already exists in the media registry ('/home/scol/.VirtualBox/VirtualBox.xml')
Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, srcDisk.asOutParam())" at line 603 of file VBoxManageDisk.cpp
Talk about a completely ambiguous error message! The solution is to provide an absolute path to the source VDI and target VDIs (leaving the path off the target will put the image in ~/.VirtualBox/HardDisks by default):
$ VBoxManage clonehd $(pwd)/WinXP-IE7.vdi $(pwd)/WinXP-IE8.vdi
VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: b7166421-9743-4808-aedf-3c90aeb7c902

perfect timing, was about to make clones of the clean xp install to setup the browser lab.
This worked for me:
$ VBoxManage clonevdi `pwd`/SDisk.vdi `pwd`/DDisk.vdi
assuming you are in the directory for both the source and dest. disk
@MikeG: Yep that works as
$(pwd)and`pwd`are equivalent.thank you!!!
Thanks for the great information!
Thx for that! I’ve been struggling for several hours now…
This shoukd be part of the VBox UserManual.pdf … Have spent half an hour on google to find your very helpful tip!
Great help – you made my day!!
I had no idea what that stupid error meant. Gave me hours of headache
Thank you for saving me a a lot of time.
N6LG – San Francisco, Ca
Thanx man… saved me a lot of swearings
Thanks a lot for this!
Thanks so much for pointing out that we needed the full path of the source file. Very obscure error message that one.
Hate to think how long it would have taken me to figure that one myself.
Cheers
Thanks! What a stupid error message, i wouldn’t have figured out i needed absolute paths without finding this article!
Just tried your solution, and the same error occured.
I ran: VBoxManage internalcommands sethduuid Windows.vdi
and that seemed to do the trick
The above recommendations did not work for me in a windows environment, but fortunitely Trent’s recommendation did
VBoxManage internalcommands sethduuid MYBox.vdi
where MYBox.vdi is the name of the virtual HD I copied.
Thanks a lot, this was a real timesaver!
Thank you!!!!!!!!!!!!!!!!!!!!!! I had the same problem and it was because I was cd’ing to the dir and just providing the relative paths to the source and destination vdi files. It works now.
Thanks dude… that fixed the issue for me.
Thanks a lot, how did you find this out?
Thank you so much for the solution….it saved me time.
Hello.
After several attempts, nothing worked for me.
The issue in my case was the spaces in the paths, when i remove them, it works!
Thank you very much and sorry for my horrible English xD
Thank you I had no idea what was going wrong.
Thanks this has saved me a lot of time googling for a fix.
Just another vote of thanks!
Thank you a lot !
Save me a lot of time …
I experienced the problem because the folder where the ISO file was kept (which virtual box read from) was in read-only mode.
After i unchecked read only … worked like a charm
if you have the character space in the path use character ‘
example:
VBoxManage clonevdi ‘/media/MASDATOS/Maquinas Virtuales/virtualBOX/WindowsXP2/DiscoWinxp2.vdi’ ‘/media/MASDATOS/Maquinas Virtuales/virtualBOX/WindowsXP2/DiscoWinxp3.vdi’
thanks a lot.
Many thanks I have been hidiously stuck with that for a while now…
Great!
This is not entirely correct. What needs to be provided is the same path that already exists in the configuration file. Usually it is the full path, but not necessarily… Just check what is there and use the same (changing your current folder if necessary).
thank you very much!
Thanks so much! I was completely stumped.
Thank you!