1. 设置共享目录

前提:必须关闭虚拟机,再点击设置

如图所示:

20231019194613

2. 使用共享目录

# 安装 open-vm-tools
yum install -y open-vm-tools

# 共享目录生效
vmhgfs-fuse /mnt/hgfs/

# 设置软链
mkdir /opt/vm-share

ln -s /mnt/hgfs/vm-share/ /opt/vm-share

3. 设置开机启动

cat >> /etc/rc.local <<EOF
vmhgfs-fuse /mnt/hgfs/
EOF