重启Ubuntu20.04后,发现共享文件夹进不去也不显示了
首先查看共享文件夹是否已经存在并且设置为总是开启
使用命令查看当前挂载的共享文件夹
vmware-hgfsclient
存在的情况下,然后使用下面命令
sudo apt-get install open-vm-tools-dkms
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=1000 -o gid=1000 -o umask=022
或者:(操作了上面命令可忽略下面两行,与上面效果一致)
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
但是由于上面的方法需要每次重启后都去设置一遍,可以把执行的命令放到/etc/rc.local 文件下;让它开机自动执行
sudo vi /etc/rc.local
若/etc/rc.local 是一个空文件则在里面添加
#!/bin/sh -e
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
给文件执行权限
sudo chmod +x /etc/rc.local
最后重启虚拟机
reboot