VirtualBox

16 年 前 建立

16 年 前 結束

#2594 closed enhancement (fixed)

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

回報者: Martin Steigerwald 負責人:
元件: other 版本: VirtualBox 1.6.6
關鍵字: 副本:
Guest type: Linux Host type: Linux

描述

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.

更動歷史 (5)

comment:1 16 年 前Martin Steigerwald 編輯

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

comment:2 16 年 前James Lucas 編輯

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 16 年 前Martin Steigerwald 編輯

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 16 年 前Martin Steigerwald 編輯

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 16 年 前Frank Mehnert 編輯

狀態: newclosed
處理結果: fixed

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

注意: 瀏覽 TracTickets 來幫助您使用待辦事項功能

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette