VMware 虚拟机挂载宿主机目录
一、在虚拟机上配置共享目录

二、 在Linux中安装vm-tools
先检查是否安装 可用查看共享目录的命令:vmware-hgfsclient
没有安装,执行
yum install -y open-vm-tools open-vm-tools-desktop
三、查看共享目录
vmware-hgfsclient
运行结果:

四、挂载目录
方法一命令挂载
mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other,nonempty vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other,nonempty
查看是否挂载成功
ls /mnt/hgfs
运行结果

方法二修改配置文件,启动自动挂载
vim /etc/fstab # 在末尾另起一行 添加: .host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0 # :wq保存退出
注:/mnt/hgfs 为虚拟机上的目录
浙公网安备 33010602011771号