找了好几篇,只有此博主的文章解决了问题,必须转一下,致敬!原文链接如下:
https://blog.csdn.net/jzzy_hony/article/details/81353944
在安装完vm-tools、设置完共享文件夹之后,原来需要挂载,而且还要设置普通用户的权限问题,在此复制一下博主的方法,留下继续学习。
(1)安装完vm-tools、设置完共享文件夹。
(2)如果想在Ubuntu中访问共享目录,还必须将共享目录挂到/mnt/hgfs/ 目录下。挂载之前,查看一下共享目录是否被识别到。
$ ls /mnt/hgfs/ #查看该目录并没有文件
$ vmware-hgfsclient #查看设置的共享目录
>>>>
qtpro
<<<<
$ sudo vmhgfs-fuse .host:/ /mnt/hgfs/ #挂载共享目录
$ sudo ls /mnt/hgfs/ #可以看到挂载成功
>>>>
qtpro
<<<<
三、普通账户读写共享目录
发现用sudo vmhgfs-fuse .host:/ /mnt/hgfs挂载共享目录后,必须要用root才能读写共享目录,所以使用vmhgfs-fuse挂载时,后面要跟参数才能正常使用。
$ sudo vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other,nonempty #挂载共享目录
$ sudo ls /mnt/hgfs/ #可以看到挂载成功
>>>>
qtpro
<<<<
$ cd /mnt/hgfs/qtpro
$ ls
>>>>
Env_Noise_Daq_Coding qtsoft
<<<<
$ touch hello.c #创建hello.c
$ ls
>>>>
Env_Noise_Daq_Coding hello.c qtsoft #确认hello.c
<<<<
$ cd ~
$ sudo umount /mnt/hgfs #卸载共享目录
————————————————
版权声明:本文为CSDN博主「jzzy_hony」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jzzy_hony/article/details/81353944