VirtualBox

15 年 前 建立

12 年 前 結束

#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

描述 (由 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).

更動歷史 (6)

comment:1 15 年 前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 15 年 前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 13 年 前anonymous 編輯

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.

回覆:  3 comment:4 13 年 前Michael Thayer 編輯

描述: 修改 (差異)

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 13 年 前Michael Thayer 編輯

摘要: 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 12 年 前Frank Mehnert 編輯

狀態: newclosed
處理結果: fixed

Fix is part of VBox 4.2.0.

注意: 瀏覽 TracTickets 來幫助您使用待辦事項功能

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