Page 1 of 1

clonehd - and misunderstanding

Posted: 29. Apr 2009, 11:27
by marten
I've just come across this command and wanted to clone an vdi file - and this tool (and its error messages and/or error hints) are not optimal. I've read a thread (the thread is locked - why ? ) about a user who was very angry about the strange semantic of this command. He was answered, that he should read the documentation.

I was also getting crazy about this command - and I read the documentation (but perhaps not the correct one).

If I go to my VDI directory and I have a file VISTA.vdi and I execute

VBoxManage clonehd VISTA.vdi VISTA-backup.vdi

(My intention is very simple: create a copy of my image) - but I only get the error message, that VISTA.vdi is already registered ! Well, I know that this VISTA.vdi is registered and actually unless this image is not running, I see no reason, why this is a problem. The documentation indeed say, that the image must be registered .... (8.16 documentation).

To make the whole stuff working: use full paths ! Wow, where is the semantic change between both commands !?

I would say, that this behaviour is - to say at least - strange.

Marten

Re: clonehd - and misunderstanding

Posted: 30. Apr 2009, 03:17
by harmscon
Thank you for your post. I was having the same problem and your solution of specifying the full path for the source virtual hard disk image worked.

Here is some terminal output as an illustration for others:
jaba@host:~/test-20090302$ VBoxManage clonehd test_virtual_machine.vmdk test_vm-clone.vdi --format VDI
VirtualBox Command Line Management Interface Version 2.2.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Cannot register the hard disk '/home/jaba/test-20090302/test_virtual_machine.vmdk' with UUID {af38d7f6-a3e0-448a-95a9-4a06ab5e07bc} because a hard disk '/home/jaba/test-20090302/test_virtual_machine.vmdk' with UUID {af38d7f6-a3e0-448a-95a9-4a06ab5e07bc} already exists in the media registry ('/home/jaba/.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
jaba@host:~/test-20090302$
jaba@host:~/test-20090302$
jaba@host:~/test-20090302$ VBoxManage clonehd /home/jaba/test-20090302/test_virtual_machine.vmdk test_vm-clone.vdi --format VDI
VirtualBox Command Line Management Interface Version 2.2.2
(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: 78a13ccd-bc74-4f12-ae85-f2a993678f9e
jaba@host:~/test-20090302$
The resultant image, test_vm-clone.vdi, was saved to the Default Hard Disk Folder specified in VirtualBox Preferences/General. In my case it was
/home/jaba/.VirtualBox/HardDisks/mosman_vm-clone.vdi

EDIT: This has been submitted to the VirtualBox bug tracker: Ticket #3888

Hope this helps.
Josh