VirtualBox

Ticket #2594 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

vboxmanage: make it easier to work with VDI files from different locations than ~/.VirtualBox/VDI

Reported by: ms Owned by:
Priority: minor Component: other
Version: VirtualBox 1.6.6 Keywords:
Cc: Guest type: Linux
Host type: Linux

Description

I have a local direcotry for VirtualBox images as I don't want to store them via NFS. Now when I want to clone an image I get this:

ms@mango:~/lokal/VirtualBox-Images> vboxmanage clonevdi Debian-Etch-Template.vdi Debian-Etch-grsec.vdi
VirtualBox Command Line Management Interface Version 1.6.6_OSE
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->OpenVirtualDiskImage(Bstr(argv[0]), vdi.asOutParam()) at line 3307!
[!] Primary RC  = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Full error info present: true , basic error info present: true
[!] Result Code = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Text        = Could not access hard disk image '/home/ms/.VirtualBox/VDI/Debian-Etch-Template.vdi' (VERR_FILE_NOT_FOUND)
[!] Component   = HardDisk, Interface: IHardDisk, {fd443ec1-000f-4f5b-9282-d72760a66916}
[!] Callee      = IVirtualBox, {2d3b9ea7-25f5-4f07-a8e1-7dd7e0dcf667}

I can do:

ms@mango:~/lokal/VirtualBox-Images> ln -s /home_lokal/ms/VirtualBox-Images/Debian-Etch-Template.vdi /home/ms/.VirtualBox/Debian-Etch-Template.vdi

And then:

ms@mango:~/lokal/VirtualBox-Images> vboxmanage clonevdi ./Debian-Etch-Template.vdi Debian-Etch-grsec.vdi
ms@mango:~/lokal/VirtualBox-Images> vboxmanage clonevdi ./Debian-Etch-Template.vdi Debian-Etch-rsbac.vdi

But now vboxmanage creates the images in ~/.VirtualBox/VDI. Thus I have to move them around again:

ms@mango:~/lokal/VirtualBox-Images> mv ~/.VirtualBox/VDI/Debian-Etch-{grsec,rsbac}.vdi .

Thus all I ask is that vboxmanage respects the path I give instead of insisting on ~/.VirtualBox/VDI. I know I could symlink VDI completely, but I want to have the option to keep some images via NFS.

I tested with VirtualBox 1.6.6 as thats the latest OSE edition I can get via backports.org for Debian Etch. I can try with a newer one in case its needed.

The issue is minor, but rather annoying.

Change History

comment:1 Changed 5 years ago by ms

PS: Ok, this was on Lenny already. Forgot that I upgraded recently. Still only 1.6.6 available for Debian Lenny.

comment:2 Changed 5 years ago by mjlucas

Just use full paths to your vdi files and it will work. If you don't put in a full path Virtual Box will assume the path is relative to the ~/.VirtualBox/VDI folder and not relative to the current working directory.

eg using your example

vboxmanage clonevdi /home_lokal/ms/VirtualBox-Images/Debian-Etch-Template.vdi /home_lokal/ms/VirtualBox-Images/Debian-Etch-grsec.vdi

comment:3 Changed 5 years ago by ms

Thanks. Now that was easy. I thought I tried it with full paths when I first saw this behavior. But well, now it works. Even with ./vdifile. Would probably still be nice if the command could look into current dir first, just like "cat", "cp" or any other command and default to create the target image in the directory of the source image.

comment:4 Changed 5 years ago by ms

Sorry... no, it doesn't work with ./vdifile... Thats what I tried yesterday as well. It just worked with the Debian Etch Template VDI cause I symlinked it. Sure its a relative path then, but its still unintuitive that way. I think vboxmanage should at least not default to ~/VirtualBox/VDI is the path contains at least one /.

comment:5 Changed 5 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Should be fixed in VirtualBox 2.2.0. Make sure to upgrade to version 2.2.2.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use