- vmware 12下安装centos7后,按往常的惯例安装vmware-tools,安装时提示建议使用open-vm-tools,于是放弃vmware-tools的安装,尝试使用open-vm-tools
首先安装open-vm-tools
yum install -y open-vm-tools
yum install -y open-vm-tools-desktop
在vmware软件中设置共享目录,然后使用下面的命令查看目录是否可用
vmware-hgfsclient
进入/etc/systemd/system目录
cd /etc/systemd/system
vi ./mnt.hgfs.service
输入下面内容
[Unit]
Description=Load VMware shared folders
Requires=vmware-vmblock-fuse.service
After=vmware-vmblock-fuse.service
ConditionPathExists=.host:/
ConditionVirtualization=vmware
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=
ExecStart=/usr/bin/vmhgfs-fuse -o allow_other -o auto_unmount .host:/ /mnt/hgfs
[Install]
WantedBy=multi-user.target
保存后,用systemctl命令使能这个service
systemctl enable mnt.hgfs.service
如果没有创建/mnt/hgfs文件夹,需要创建
mkdir -p /mnt/hgfs
重启后检查共享目录是否已经挂载到/mnt/hgfs目录下了