Ticket #6541 (new defect) — at Version 4

Opened 10 years ago

Last modified 7 years ago

Virtual machine name accepts forward slashes and creates malformed vm directories

Reported by: Sm0k1n Owned by:
Component: other Version: VirtualBox 3.1.6
Keywords: machine, name, slash Cc:
Guest type: other Host type: other

Description (last modified by michael) (diff)

An example would be the vm name: "dir/anotherdir". VirtualBox accepts it and this tree and config file comes up:


if I then rename the machine to "hello" this shows up:


This only appears when the machines are created. If I try to rename an existing machine this is what I get:

ERROR: Could not rename the directory '/user/.VirtualBox/Machines/test' to 
'/root/.VirtualBox/Machines/test/test' to save the settings file (VERR_FILE_NOT_FOUND)

Details: code NS_ERROR_FAILURE (0x80004005), component Machine, interface IMachine, callee nsISupports

Context: "SaveSettings()" at line 1642 of file VBoxManageModifyVM.cpp

I suspect the latter is the desired functionality.

Note: I have tested this through the GUI of a Windows machine (VBox 3.0.0) and through the CLI and API on a Linux machine (VBox 3.1.6).

Change History

comment:1 Changed 9 years ago by Sm0k1n

I just encountered an effect of this "feature" that is not as minor as I originally thought. I have a few machines with slashes in their names as shown above. When I attempt to powerUp() these machines the webservice crashes and I get this error

SoapFault exception: [HTTP] Error Fetching http headers in /.../vboxServiceWrappers.php:3655 Stack trace: #0 [internal function]: SoapClient->__doRequest('back

In my wrappers file, row 3655 is the waitForOperationCompletion() method of the IProgress class and I call this method on the IProgress object returned by the powerUp() method. This error only occurs when I attempt to start the machines from a local session, the automatic start when opening a remote session seems to work fine.

comment:2 Changed 9 years ago by Sm0k1n

While browsing through the API docs I found this for IMachine::name:

The machine name can contain only characters that are valid file name characters according to the rules of the file system used to store VirtualBox configuration. 
If any of the above limitations are hit, saveSettings will return an appropriate error message explaining the exact reason and the changes you made to this machine will not be saved.

Obviously, this is not happening and needs to be fixed.

comment:3 follow-up: ↓ 4 Changed 8 years ago by john.doe

I think slash handling in VM directories should be corrected. I don't like that it creates additional subdirectories because of slash in the VM name. Just replace any special characters in the VM directory name with "_" or something else.

comment:4 in reply to: ↑ 3 Changed 8 years ago by michael

  • Description modified (diff)

Replying to john.doe:

Just replace any special characters in the VM directory name with "_" or something else.

As of 16 Feb 2012 we do this in the development version of VirtualBox. Any major releases after this date will contain the fix.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use