Muffinresearch Labs by Stuart Colville

VirtualBox: Error: Cannot register the hard disk | Comments (16)

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

Post Tools

Comments: Add yours

1. On July 24th, 2009 at 9:26 am Rajat Pandit said:

perfect timing, was about to make clones of the clean xp install to setup the browser lab.

2. On August 27th, 2009 at 5:15 pm MikeG said:

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

3. On August 28th, 2009 at 8:26 am Stuart Colville said:

@MikeG: Yep that works as $(pwd) and `pwd` are equivalent.

4. On September 21st, 2009 at 8:21 am Gabriele Violino said:

thank you!!!

5. On October 14th, 2009 at 3:29 am Mark said:

Thanks for the great information!

6. On October 28th, 2009 at 12:29 pm Sibi said:

Thx for that! I’ve been struggling for several hours now…

7. On November 13th, 2009 at 1:51 pm Mircsicz said:

This shoukd be part of the VBox UserManual.pdf … Have spent half an hour on google to find your very helpful tip!

8. On November 15th, 2009 at 9:12 pm CPP said:

Great help – you made my day!!
I had no idea what that stupid error meant. Gave me hours of headache :-)

9. On November 22nd, 2009 at 8:51 pm N6LG said:

Thank you for saving me a a lot of time.

N6LG – San Francisco, Ca

10. On November 25th, 2009 at 10:02 am Tuzemec said:

Thanx man… saved me a lot of swearings ;-)

11. On December 7th, 2009 at 1:54 pm shinki said:

Thanks a lot for this!

12. On December 19th, 2009 at 7:10 am pete said:

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

13. On January 14th, 2010 at 12:55 pm Hay said:

Thanks! What a stupid error message, i wouldn’t have figured out i needed absolute paths without finding this article!

14. On February 3rd, 2010 at 6:25 am Trent said:

Just tried your solution, and the same error occured.

I ran: VBoxManage internalcommands sethduuid Windows.vdi

and that seemed to do the trick ;)

15. On February 10th, 2010 at 2:43 pm James said:

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.

16. On February 11th, 2010 at 3:25 pm AK said:

Thanks a lot, this was a real timesaver!







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.572s.