需要VMware中安装CentOS7
一
1、设置win中的文件共享
2、安装工具
进入对应的工具目录 cd /run/media/jhy/VMware Tools
将文件复制到家目录 cp VMwareTools-10.2.5-8068393.tar.gz /
解压文件 tar -xzvf VMwareTools-10.2.5-8068393.tar.gz
运行文件 ./vmware-install.pl
一直enter
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes] no
输入 no
The path "" is not a valid path to the 3.10.0-514.26.2.el7.x86_64 kernel
headers.
Would you like to change it? [yes] no
输入 no
---------------------
安装完成
Enjoy,
--the VMware team
二 挂载文件
mnt/hgfs 目录
[jhy@localhost ~] cd /mnt/hgfs/
[jhy@localhost hgfs] pwd
/mnt/hgfs
vmware-hgfsclient 命令查看当前共享的目录
[jhy@localhost hgfs]$ vmware-hgfsclient
mount报错
[jhy@localhost hgfs]$ sudo mount -t vmhgfs .host:/E /mnt/hgfs
Error: cannot mount filesystem: No such device
vmhgfs-fuse,需要安装工具包
[jhy@localhost hgfs]$ sudo yum install open-vm-tools-devel -y
[jhy@localhost hgfs]$ sudo vmhgfs-fuse .host:/project /mnt/hgfs -o nonempty -o allow_other
---------------------
报错:找了答案
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
可将nonempty选项加到里面去
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
---------------------
记住,一定要加allow_other选项,不然之后的hgfs文件普通用户不能访问如果之前没有加-o allow_other,已经使得文件hgfs在普通用户环境下不可访问,也就是提示了
返回上级目录从新进入看到文件挂载成功,与win10中共享文件相同,大功告成!