2014年7月22日 星期二

Virtualbox 共用資料夾無法symbolic link問題

在寫case的時候遇到無法建symbolic link的問題,顯示唯讀的檔案系統。搜尋了一下發現是virtualbox在win7上的問題,跟管理員權限與virtualbox要打開設訂有關。

Fixing your virtualbox shared folder symlink error

Operations such as installing node.js or python virtualenv to a virtualbox writable shared folder can fail if you try to do this as a linux (ubuntu) virtualbox guest running Windows 7 host.
The cause is symlink permission.
Typical error:
ln -fs out/Release/node node
ln: failed to create symbolic link `node': Read-only file system
It can also be a “Protocol error”.
This happens even if your shared folder is writable.

Fix: Enable symlinks feature in VirtualBox

Run at cmd prompt:
  1.     
  2. VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1  
  3.     
Verify by running:
  1.     
  2. VBoxManage getextradata YOURVMNAME enumerate  
  3.     
If your user belongs to Administrators group then start VirtualBox with “Run as Administrator”!

上面的參數請視情況修改:
  • c:\Oracle\VirtualBox\ : 這是VirtualBox的預設資料夾,如果安裝在不同資料夾,請自行修改。
  • YOURVMNAME : 請修改為你要開啟的VM名稱。
  • YOURSHAREFOLDERNAME :修改為VM設定中共用資料夾的名稱

參考資料
http://www.plumeqi.com/post/VirtualBox-shared-folder-symlin-error.html
http://ahtik.com/blog/2012/08/16/fixing-your-virtualbox-shared-folder-symlink-error/
http://gwokae.mewggle.com/wordpress/index.php/archives/1097