linux(ubuntu18.04)虚拟机目录挂载映射到windows目录

1,在vmware中设置windows共享目录 F:\html
在这里插入图片描述
2,在ubuntu中安装open-vm-tools

apt-get install open-vm-tools open-vm-tools-desktop
3,在ubuntu中用vmtools挂载共享目录

[root@ubuntu~]# vmware-hgfsclient //查看共享的目录
html
[root@ubuntu~]#
vmhgfs-fuse .host:/ /var/www -o nonempty -o allow_other
挂载目录
[root@ubuntu~]# ls /var/www/
html
[root@fedora ~]# ls /var/www/html

4,上面的设置让F:\html = /var/www/html;

5,在windows F:\html 新增文件, /var/www/html会出现

备注:
我用mount挂载行不通,一直报错:Error: cannot mount filesystem: No such device

这里安装一下:sudo apt-get install open-vm-tools-dkms
然后命令:sudo vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

记住,一定要加allow_other选项,不然之后的hgfs文件普通用户不能访问

如果之前没有加-o allow_other,已经使得文件hgfs在普通用户环境下不可访问,也就是提示了

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the ‘nonempty’ mount option
可将nonempty选项加到里面去
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值