可以在挂载的文件系统上创建和删除文件,但不能创建链接或更改所有权 [英] Can create and delete files on mounted file system yet not create links or change ownership

查看:157
本文介绍了可以在挂载的文件系统上创建和删除文件,但不能创建链接或更改所有权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10主机上的VM(VirtualBox)中运行了Xubuntu安装. Windows文件系统上有一个目录,我已将其作为vboxsf安装在客户机中.我认为这是Linux问题,但如果有相关性,那就是背景.

I have a Xubuntu install running in a VM (VirtualBox) on a Windows 10 host. There is a directory on the Windows file system which I have mounted in the guest as a vboxsf. I think it's a Linux problem but that's the background in case it's relevant.

我对该目录及其中的所有文件均具有写权限(所有内容均为-rwxrwxrwx).我可以在其中创建,修改和删除文件和目录.但是,尝试创建软链接(ln -s)或将文件或目录添加到其他所有者将产生以下消息:

I have write access to this directory and all files within it (everything is -rwxrwxrwx). I can create, modify and delete files and directories in it. But trying to create a soft link (ln -s) or chown a file or directory to a different owner produces the following message:

ln: failed to create symbolic link 'myLink': Read-only file system

已经尝试了我能想到的一切,包括卸载和重新安装.我不知道如何写,修改和删除文件,但是符号链接会产生只读"字样.交易完成没有任何错误或警告,但完成后仍未更改所有权.

Have tried everything I can think of including unmounting and re-mounting. I don't understand how I am able to write, modify and delete files, yet a symbolic link produces "read only". Chown completes without an error or warning, but still hasn't changed ownership when done.

推荐答案

所以最终我找到了答案.这是VirtualBox本身的错误/设计决定.看到这里:

So eventually I found the answer to this. It's a bug / design decision in VirtualBox itself. See here:

https://www.virtualbox.org/ticket/10085

他们曾经支持它,然后意识到它启用了一个非常难以修复的安全漏洞,因此特意禁用了其共享文件夹中的链接.周围没有出色的工作.您可以编辑

They used to support it and then realised it enabled a very hard to fix security vulnerability and so deliberately disabled linking in their shared folders. There's no great work around. You can edit your

添加以下内容:

<ExtraDataItem name="VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME" value="1"/> 

那会带来安全风险,因此您必须信任您的客人.您还可以(这就是我可能要做的)创建NFS挂载点,并以更传统的方式连接到它.

That comes with security risks so you must trust your guest. You can also (and this is what I might do) create an NFS mount point and connect to it in more old school ways.

这篇关于可以在挂载的文件系统上创建和删除文件,但不能创建链接或更改所有权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆