[转]virtualbox共享文件夹无法创建软链接的解决方法

本文解决在Ubuntu虚拟机中安装Node.js或Python virtualenv到可写的VirtualBox共享文件夹时遇到的符号链接权限问题。通过启用VirtualBox的符号链接功能,可以避免出现“只读文件系统”或“协议错误”。文中提供了具体的命令行操作步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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!

转载于:https://www.cnblogs.com/elta/articles/3763953.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值