1.在VMware中设置共享文件夹:

在这里插入图片描述

2.在Linux中安装vm-tools:

yum install -y open-vm-tools open-vm-tools-desktop

或者是
在这里插入图片描述

3.挂载:

查看共享的目录

# vmware-hgfsclient
data1

执行命令挂载目录

mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other,nonempty

修改数据令系统启动时自动挂载

vim /etc/fstab
#在末尾另起一行 添加:
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0
# :wq保存退出

再次挂载目录

vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other,nonempty

查看是否成功

ls /mnt/hgfs

软连接至目标根目录:

ln -s /mnt/hgfs/html /var/www
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐