ubuntu22.04 configuration shared folder cannot find /mnt/hgfs

I happily installed Ubuntu 22.04 in the virtual machine and added a shared folder. As a result, there is no hgfs folder in /mnt, let alone the shared folder winShare. Then I checked on the Internet how to do it, and the operation was as fierce as a tiger, and it was finally solved!

Environment: (1) VMware Workstation 16 Pro, 16.2.3
(2) Ubuntu 22.04

Check the set shared directory, if it is displayed, it means that there is no problem with the vmware setting

vmware-hgfsclient

insert image description here
1. Install VMware tools first

sudo apt install open-vm-tools

2. Manually create the /mnt/hgfs directory

sudo mkdir /mnt/hgfs

3. Execute the following command, you can see the shared directory you configured under /mnt/hgfs

vmhgfs-fuse .host:/share /mnt/hgfs    #share:你的共享目录名

4. If it fails, you need to set the boot to automatically mount

sudo vi /etc/fstab

Then use the command ato make the file editable, and the following line at the end of the file

.host:/  /mnt/hgfs  fuse.vmhgfs-fuse  allow_other  0  0

Then press Esc, , xto save the modified file and exit.
Notice:
Do not restart immediately, first use mount -a to test (if it prompts that you have no permission, as shown in the figure below, use sudo mount -athe test), to avoid errors that cause the machine to fail to boot, and restart if there is no problem.
insert image description here

Guess you like

Origin blog.csdn.net/qq_28077617/article/details/127578863