After ubuntu sets the shared folder, it is not displayed, and /mnt/hgfs is empty.

1. Set up shared folders

First open Ubuntu, click on the virtual machine, click on Settings, and add shared folders according to the order of the signs;

 After the addition is successful, enter the /mnt/hgfs directory and view the shared folder

cd /mnt/hgfs

 


2. Solve the problem that shared folders are not displayed

 

1. First enter the following command to check whether the shared folder is indeed set up successfully.

If vmware-hgfsclient
has indeed set up a shared folder, it will output the name of the shared folder under the window.

 

2. Make sure you have set up the shared folder and enter the following command

//If the command package does not exist, execute this command first sudo apt-get install open-vm-tools
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
but it will become invalid after restarting. You need to mount once

3. Solve the problem of shared folder failure after restarting

Enter /etc/fstab

vim /etc/fstab
add a line at the end:

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0
Because this file is a read-only file, the specific adding method is as follows:

1. First move the cursor to the last digit of the last line and press a (enter insert mode behind the cursor)

2. Press the Enter key again and enter manually or use shift+insert to copy the above code.

3. Press esc to exit insert mode and enter: wq (save and exit)

It will be automatically mounted on subsequent reboots.
————————————————
Copyright statement: This article is an original article by CSDN blogger "Han in the High Place", and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link for reprinting and this Statement.
Original link: https://blog.csdn.net/weixin_61725973/article/details/128148695

Guess you like

Origin blog.csdn.net/weixin_62529596/article/details/132320811