VirtualBox

Opened 15 years ago

Closed 12 years ago

#6541 closed defect (fixed)

Virtual machine name accepts forward slashes and creates malformed vm directories -> fixed as of 16 Feb 2012 for future major releases

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 Thayer)

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

/user/.VirtualBox/Machines/dir/anotherdir/dir/anotherdir.xml

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

/root/.VirtualBox/Machines/dir/anotherdir/dir/hello.xml

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 (6)

comment:1 by Sm0k1n, 14 years ago

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 by Sm0k1n, 14 years ago

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 by anonymous, 13 years ago

I think slash handling in VM directories should be corrected. http://img823.imageshack.us/img823/3434/virtualboxvmnameslash.png 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.

in reply to:  3 comment:4 by Michael Thayer, 13 years ago

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.

comment:5 by Michael Thayer, 13 years ago

Summary: Virtual machine name accepts forward slashes and creates malformed vm directoriesVirtual machine name accepts forward slashes and creates malformed vm directories -> fixed as of 16 Feb 2012 for future major releases

comment:6 by Frank Mehnert, 12 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 4.2.0.

Note: See TracTickets for help on using tickets.

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