使用 open-vm-tools 启用共享文件夹

使用 open-vm-tools 启用共享文件夹

我在 Windows 7 上的 VMware Player 中运行 Ubuntu 14.10。我安装了 open-vm-tools 而不是 VMware Tools,因为 VMware 的软件无法编译文件共享所需的内核模块。我无法使用 或 挂载共享文件夹sudo mount -t vmhgfs .host:/$(vmware-hgfsclient) /mnt/hgfssudo vmware-hgfsmounter .host:/$(vmware-hgfsclient) /mnt/hgfs两者都返回Error: cannot canonicalize mount point: No such file or directory。我不知道这是指什么,也不知道如何修复它。

答案1

我解决这个问题的方法是利用与 open-vm-tools 一起安装的 vmhgfs-fuse。

使用 进行本地挂载vmhgfs-fuse .host:/$(vmware-hgfsclient) ~/some_mountpoint或使用 进行全局挂载sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other。然后,要使挂载全局持久化,请将以下行添加到/etc/fstab

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0

答案2

由于其他答案对我来说不起作用,经过长时间的挖掘,我终于从这个链接使它工作了:Ubuntu VM 上的 /mnt/hgfs 中缺少文件?其中 PieCot 给出了解决方案:

$ git clone https://github.com/rasa/vmware-tools-patches.git
$ cd vmware-tools-patches
$ ./patched-open-vm-tools.sh

答案3

在虚拟机上确保:

您已启用文件夹共享

主机和客户机之间至少有一个共享文件夹

在 Ubuntu 客户机上:

检查 /mnt/hgfs 以查看您是否可以访问该文件夹,如果无法访问,请运行此工具命令:

sudo vmware-config-tools.pl

使用以下方法更新 fstab:

gksu gedit /etc/fstab

使用文本编辑器在文件末尾输入以下内容:

.host:/{shared-folder} /{path-to-mount-on} vmhgfs defaults,ttl=5,uid=1000,gid=1000   0 0

最后一步是重新启动您的虚拟机(您可能需要重新启动它,否则会收到无法挂载的错误,只需跳过这一步并重新启动几次)!

谢谢,希望这有帮助!

答案4

这对于我在 Debian 中工作有效,我想在 Ubuntu 上也是一样的。

安装 open-vm-tools-dkms 包。

apt-get install open-vm-tools-dkms

创建挂载点。

mkdir /mnt/hgfs

挂载所有chares到挂载点。所有用户均有权限

/usr/bin/vmware-vmblock-fuse /mnt/hgfs -o allow_other

相关内容