原因:可能是对应的驱动在重启后并没有安装
1、首先确认共享文件夹是开启的,且是挂载的
2、创建一个命令
sudo vim /etc/systemd/system/mnt-hgfs.mount
把下面的内容粘贴在这个文件上,并保存:
[Unit]
Description=VMware mount for hgfs
DefaultDependencies=no
Before=umount.target
ConditionVirtualization=vmware
After=sys-fs-fuse-connections.mount
[Mount]
What=vmhgfs-fuse
Where=/mnt/hgfs
Type=fuse
Options=default_permissions,allow_other
[Install]
WantedBy=multi-user.target
3、创建一个fuse模块
sudo vim /etc/modules-load.d/open-vm-tools.conf
把下面的内容粘贴在这个文件上,并保存:
fuse
If the file already exists, add that line to the file.
4、使能命令
sudo systemctl enable mnt-hgfs.mount
5、加载模块
sudo modprobe -v fuse
6、开始该命令
sudo systemctl start mnt-hgfs.mount
6、确认共享文件夹设置并开启,重启
reboot
7、重启完再次查看共享文件夹目录,之前设置的共享文件夹已经生效
具体可参考下面的文档:
Ubuntu下解决共享文件夹共享失败 - walteronly1 - 博客园 (cnblogs.com)
VMware虚拟机中的Linux重启后共享文件夹失效的解决方法_使用vmhgfs-fuse进行隐射后,下次开机有没有了怎么解决-CSDN博客