优麒麟系统虚拟机重启之后共享文件夹不可用了(为空文件夹)

本文记录了在Ubuntu虚拟机中遇到VMware共享文件夹消失及权限问题的解决过程。通过卸载、修改权限及重新挂载,最终使用`umount /mnt/hgfs`、`chmod 777 /mnt/hgfs`和`vmhgfs-fuse.host://mnt/hgfs`命令成功解决。此外,还提到了一些不成功的尝试和参考资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

创作开始时间:2021年11月24日17:35:03

碰到这些问题是真的坑,还挺难解决的(跟修bug一样?),这里记录一下解决方案。

环境

  • VMWare
  • 优麒麟系统的虚拟机

问题描述及解决

1)虚拟机开机之后发现共享文件夹无了。即/mnt/hgfs下面没东西了。之前是有shared文件夹的

2)开始尝试各种解决方案,最后下面的指令成功了:

简单版本:(一次过)

# 先卸载/解除挂载 这个文件夹
sudo umount /mnt/hgfs

# sudo一下设置权限
apr@ubuntu:/mnt$ sudo chmod 777 /mnt/hgfs/

# 挂载一下
apr@ubuntu:/mnt$ vmhgfs-fuse  .host:/ /mnt/hgfs

复杂版本:(包含一些失败的尝试)

# 这个貌似可选,不知道有用否!
apt-get install open-vm-*

# 先卸载/解除挂载 这个文件夹
sudo umount /mnt/hgfs

# 然后重新挂载
# 提示我没权限,看来得先 chmod 777一下。
apr@ubuntu:/mnt$ vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs
fusermount: user has no write access to mountpoint /mnt/hgfs

# 不行,得sudo
apr@ubuntu:/mnt$ chmod 777 /mnt/hgfs/
chmod: changing permissions of '/mnt/hgfs/': Operation not permitted

# sudo了
apr@ubuntu:/mnt$ sudo chmod 777 /mnt/hgfs/

# 不行,得删去 -o 指令
apr@ubuntu:/mnt$ vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf

# 删掉了
apr@ubuntu:/mnt$ vmhgfs-fuse  .host:/ /mnt/hgfs

参考:

  • How to change permission of vmware’s shared folder https://stackoverflow.com/questions/37871470/how-to-change-permission-of-vmwares-shared-folder 提供了vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs指令
  • fusermount: user has no write access to mountpoint /data #2 https://github.com/tynor88/docker-rclone-mount/issues/2 提供了chmod 777指令

其他的多少不适合,也记录一下吧:

  • 解决问题:fusermount: user has no write access to mountpoint /mnt/hgfs与问题:无法定位软件包 open-vm-dkms https://blog.csdn.net/weixin_38137947/article/details/106717624
  • 问题:fusermount: user has no write access to mountpoint /mnt/hgfs与问题:无法定位软件包 open-vm-dkms https://www.144d.com/post-566.html
  • Change folder permissions and ownership https://askubuntu.com/questions/6723/change-folder-permissions-and-ownership
  • 虚拟机重启后找不到共享文件夹 https://blog.csdn.net/weixin_42024824/article/details/109532731 被这个指令vmhgfs-fuse /mnt/hgfs/小坑了一下。

失败尝试

1)删除共享文件夹,重新添加。没用

在这里插入图片描述

小结

以上。

创作结束时间:2021年11月24日17:42:37

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值