VirtualBox

Opened 11 years ago

Last modified 11 years ago

#11489 new defect

vboxmanage showhdinfo does not work with relative pathes

Reported by: Max D Owned by:
Component: other Version: VirtualBox 4.2.4
Keywords: vboxmanage showhdinfo path Cc:
Guest type: all Host type: Linux

Description

vboxmanage showhdinfo seems to be broken in 4.2.4 & 4.2.6

Some of my VDI disk :

virtualbox@gateway:~$ vboxmanage list hdds | grep vSRV001
Location:    /home/virtualbox/VirtualBox VMs/vSRV001/vSRV001-001.vdi
Usage:       vSRV001 (UUID: 30740f89-b026-466f-9b78-9cd8000e0f0d)

This works :

virtualbox@gateway:~$ vboxmanage showhdinfo "/home/virtualbox/VirtualBox VMs/vSRV001/vSRV001-001.vdi"
UUID:                 f6c75dcf-682b-4396-9e49-54202f465afe
Accessible:           yes
Logical size:         20480 MBytes
Current size on disk: 14461 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
In use by VMs:        vSRV001 (UUID: 30740f89-b026-466f-9b78-9cd8000e0f0d)
Location:             /home/virtualbox/VirtualBox VMs/vSRV001/vSRV001-001.vdi

If I try using a . to refer from the current directory:

virtualbox@gateway:~$ pwd
/home/virtualbox
virtualbox@gateway:~$ vboxmanage showhdinfo "./VirtualBox VMs/vSRV001/vSRV001-001.vdi"
VBoxManage: error: Cannot register the hard disk '/home/virtualbox/./VirtualBox VMs/vSRV001/vSRV001-001.vdi' {f6c75dcf-682b-4396-9e49-54202f465afe} because a hard disk '/home/virtualbox/VirtualBox VMs/vSRV001/vSRV001-001.vdi' with UUID {f6c75dcf-682b-4396-9e49-54202f465afe} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp

But this would work:

virtualbox@gateway:~$ pwd
/home/virtualbox
virtualbox@gateway:~$ vboxmanage showhdinfo "VirtualBox VMs/vSRV001/vSRV001-001.vdi"
UUID:                 f6c75dcf-682b-4396-9e49-54202f465afe
Accessible:           yes
Logical size:         20480 MBytes
Current size on disk: 14461 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
In use by VMs:        vSRV001 (UUID: 30740f89-b026-466f-9b78-9cd8000e0f0d)
Location:             /home/virtualbox/VirtualBox VMs/vSRV001/vSRV001-001.vdi

I understand the check to find if the disk has a corresponding UUID but the path check seems off to me.

Change History (1)

comment:1 by Frank Mehnert, 11 years ago

Summary: vboxmanage showhdinfo brokenvboxmanage showhdinfo does not work with relative pathes

VBoxManage showhdinfo is not broken but might behave unexpected with relative pathes. The reason is that a relative path is always treated as relative to the current working directory of the VBoxSVC daemon. This behavior might be improved but I don't think the function is broken.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use