#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
回報者: | Sm0k1n | 負責人: | |
---|---|---|---|
元件: | other | 版本: | VirtualBox 3.1.6 |
關鍵字: | machine, name, slash | 副本: | |
Guest type: | other | Host type: | other |
描述 (由 作最後更新)
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).
更動歷史 (6)
comment:2 15 年 前 由 編輯
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.
跟進: 4 comment:3 13 年 前 由 編輯
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.
comment:4 13 年 前 由 編輯
描述: | 修改 (差異) |
---|
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.
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
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.