VMware虚拟机中共享文件夹 开机启动

输入命令:

sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=1000 -o gid=1000 -o umask=022

即可(uid, gid可通过id命令查询)。
备注:网上的 sudo vmhgfs-fuse .host:/ /mnt/hgfs 是不行的!亲测。

参考:https://jarviswwong.com/ubuntu-vmware-hgfs-permissions-problem.html

vmware安装centos7后使用共享文件夹,但是每次重启后就找不到共享的文件夹了。原因没有深究,所以就想到了加个开机脚本来执行那个挂载命令。步骤如下:

1、打开 /etc/rc.local文件
 
 
2、添加如下命令
 
sudo umount /mnt/hgfs

sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=1000 -o gid=1000 -o umask=022
 

添加完成后是这样的

 
3、添加可执行权限chmod +x /etc/rc.local
4、启动服务systemctl start rc-local.service
5、检查状态systemctl status rc-local.service
 
 
6、开机启动systemctl enable rc-local.service

好了,我们再次重启后就可以自动挂载啦!



作者:Fizz_YF
链接:https://www.jianshu.com/p/722d78f9ed3e
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
原文地址:https://www.cnblogs.com/brady-wang/p/13742970.html