Need help cloning HD not located in ~/.VirtualBox

Discussions related to using VirtualBox on Linux hosts.
Post Reply
rnsc
Posts: 4
Joined: 25. Jan 2009, 22:59

Need help cloning HD not located in ~/.VirtualBox

Post by rnsc »

Home directories on are a network server. Keeping virtual machine drive images there would be very slow.

Created a local directory (/vm/vb) for these images.

Created the "New" drive image there when the VM was created. Also change the snapshot location to be in a subdirectory (/vm/vb/VW2K).

Installed Win2K and configured lots of stuff. Want to now clone it for use, so I never have to install Windows again!

I have tries 3 ways, and it appears that VirtualBox insists on disk images being kept in ~/.VirtualBox.

Is there a way that I can keep the images where I want them, and clone them when and where I want them, and move them around? Or as a fallback, simply respecify the one "magic" location to move it out of ~/.VirtualBox?

Thanks.
--Ray


[Try #1] Naively assume that "filename" means a typical UNIX filename, that will be interpreted relative to the current directory:

cd /vm/vb
VBoxManage clonehd VW2K32G.1.0.vdi VW2K32G.1.1.vdi -remember
Fails:

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling a->virtualBox->OpenHardDisk2(src, srcDisk.asOutParam()) at line 369!
[!] Primary RC = VBOX_E_IPRT_ERROR (0x80BB0005) - Runtime subsystem error
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_IPRT_ERROR (0x80BB0005) - Runtime subsystem error
[!] Text = Could not get the storage format of the hard disk '/home/jennifer/.VirtualBox/HardDisks/VW2K32G.Base.1.0.vdi' (VERR_FILE_NOT_FOUND)
[!] Component = HardDisk2, Interface: IHardDisk2, {ed6e2525-c2fd-42a4-917a-7a9045ac9e15}
[!] Callee = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}

[Try #2] Try a full path, pointing it to the source disk image since it appears to be assuming that filenames are in ~/.VirtualBox:

VBoxManage clonehd /vm/vb/VW2K32G.Base.1.0.vdi /vb/vm/VW2K32G.Base.1.1.vdi -remember

Fails saying that it cannot create the target directory. /vm is owned by root, mode 755, /vm/vb is owned by root, mode 777:

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the directory '/vb/vm' (VERR_ACCESS_DENIED)

[Try #3] Use full paths everywhere:

VBoxManage clonehd /vm/vb/VW2K32G.Base.1.0.vdi /vb/vm/VW2K32G.Base.1.1.vdi -remember
Fails, again saying that it cannot create /vb/vm:

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the directory '/vb/vm' (VERR_ACCESS_DENIED)
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

If your images are not in the default folder then you need to specify the full path in the clonehd command.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
rnsc
Posts: 4
Joined: 25. Jan 2009, 22:59

Post by rnsc »

TerryE wrote:If your images are not in the default folder then you need to specify the full path in the clonehd command.
Note my "[Try #3]", where I specify the full path for both the source and the destination.

I also notice that my "Try #2]" was documented incorrectly. In "Try #2" I specified the complete path for the source, but not the destination.

In both cases it is trying to create the target directory, which already exists: It does not *need* to be created! This sounds like a bug.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry, there is a ticket on this one: http://www.virtualbox.org/ticket/2734

If your want to add your details (and thus track it), you need to register for a wiki user account (this is different to a forum account sorry) and log onto the public Bugtracker.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Post by baf »

Workaround:
1. Use normal cp to copy it.
2. Do
VBoxManage internalcommands sethduuid <filepath>
or in earlier versions
VBoxManage internalcommands setvdiuuid <filepath>
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
Post Reply