VMWare中安装的ubuntu怎么与本地物理机共享文件夹

vmware中:

1、虚拟机--设置--选项--共享文件夹(设置如下)

2、 ubuntu中挂载共享文件夹

2.1、如果之前已经挂载 hgfs,先取消挂载
sudo umount /mnt/hgfs
2.2、重新使用以下命令挂载
sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=0 -o gid=0 -o umask=022
  • uid 和 gid 在home目录输入id 命令查询,如果报错 use the ‘nonempty’ mount option则使用下面命令
sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other -o uid=0 -o gid=0 -o umask=022

3、永久设置(上面设置在重启后又找不到共享文件夹)

先使用下面命令提升权限,否则无法保存

sudo chmod 777 /etc/fstab

进入/etc目录打开fstab文件编辑末尾添加

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,uid=0,gid=0,umask=022 0 0

保存成功后重启虚拟机即可,共享文件夹永久不丢失。

注:为了方便使用,可以使用软链接到方便访问的路径

在windows物理机中:

1、共享文件夹设置(右键--属性--共享--高级共享)

具体设置如下:

2、完成后效果

猜你喜欢

转载自blog.csdn.net/weixin_41172713/article/details/140882356