[转]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”!

If user is not in Administrators group

By default Windows 7 security policy does not allow creating symlinks as it’s a potential security threat. Run “secpol.msc” and navigate to “Local Policies-User Rights Assignments” and add your user to “Create symbolic links”. I didn’t try that but could be that after that virtualbox could be run as a regular user.

Speculation: The controversy is that users with admin group seem to be unable to create symlinks even after granting the permission unless they use “run as admin”. Maybe symlink privilege gets filtered out for regular runs when user belongs to Administrators. Any ideas?

Let me know if it helps or if there’s an easier way!

posted @ 2014-06-02 01:05  Elta  阅读(3503)  评论(0编辑  收藏  举报