VirtualBox

Ticket #13531 (new defect)

Opened 8 years ago

VBoxManage "c:\" argument handling

Reported by: Sobek Owned by:
Component: other Version: VirtualBox 4.3.18
Keywords: Cc:
Guest type: all Host type: Windows

Description

on the Microsoft Windows host I run 'cmd' and enter:
cd %programfiles%
cd Oracle
cd VirtualBox
VBoxManage setproperty machinefolder "c:\"


The quotes are straight. In
VirtualBox -- File -- Preferences... -- General -- Default Machine Folder
this is displayed as:
c:\
in the textbox. There is no icon to the left side of the text.


In the file
%userprofile%\.VirtualBox\VirtualBox.xml
it is stored as:
<SystemProperties defaultMachineFolder="c:&quot;" ...



This will lead to:
a) wrong folders being used.
New virtual machines created with VirtualBox.exe will be stored in
"%userprofile%\%VBOXNAME%\"
instead of
"c:\%VBOXNAME%\"

The snapshot folder of the virtual machine is wrong as well.


b) errors if you programmatically create a virtual machine.
If you set the machinefolder:
VBoxManage setproperty machinefolder "c:\"

The VM creation/registration command :
VBoxManage createvm --name "%VBOXNAME%" --ostype Windows7 --register

will fail with the error message:
VBoxManage.exe: error: Invalid machine settings file name 'C:\Users\user\"\VB-USER\VB-USER.vbox' (VERR_INVALID_NAME)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 275 of file VBoxManageMisc.cpp


Note: the problem applies to the following parameters as well:
VBoxManage createvm --basefolder
VBoxManage modifyvm --snapshotfolder


For example, if you run
VBoxManage setproperty machinefolder "c:\"
and
VBoxManage createvm --basefolder "c:\"
The settings file will be stored in:
%userprofile%\%VBOXNAME%\%VBOXNAME%.vbox
The Snapshot folder will be stored in:
%userprofile%\%VBOXNAME%\%VBOXNAME%\Snapshots

I leave out the example of the snapshotfolder.


The workaround I found is instead of
"c:\"
use

"c:\\"

OR

c:\

as argument to machinefolder/basefolder/snapshotfolder parameter.

In "%userprofile%\.VirtualBox\VirtualBox.xml"

"c:\\"

is stored as
<SystemProperties defaultMachineFolder="c:\"

c:\ is stored as
<SystemProperties defaultMachineFolder="c:\"

Either workaround will display a folder icon in
VirtualBox -- File -- Preferences... -- General -- Default Machine Folder




Note:
on Fedora 20 x86_64 you can use "/" as a machine folder without problem.
I had to start VirtualBox with root-permissions to work with this, though.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use