Linux - Solution to the shared folder not found by virtual machine restart
The solution after searching for a bunch of tutorials at the beginning is to open the terminal and execute it every time you restart.
sudo vmhgfs-fuse .host:/ /mnt/hgfs/ -o allow_other -o uid=1000
vmware
The file sharing in the virtual machine is a name calledvmhgfs-fuse
The module seems to be not mounted by default every time it is started, and I don’t know what’s going on. The above command callvmhgfs-fuse
The module hangs the shared file to/mnt/hgfs
but the following -o must be added, otherwise only the root user can use the folder.
It is not convenient to enter commands to hang up the folder every time you start. Naturally, I thought of starting the computer and executing the commands. How to do it? There are several ways:
-
Create a script to execute the boot mount command in /etc/. It is probably because the command requires root permissions, so it is useless
-
The last line of fstab writes the mount instruction: (successful)
- First install open-vm-tools:
sudo apt install open-vm-tools
-
Then
vim /etc/fstab
, enter it on the last line of the file (note that you need root permission).host:/ /mnt/hgfs -fuse allow_other 0 0
Finished
wq!
Save, reboot and then cd/mnt/hgfs
Check it out and it succeeded.
Experience
This is not the first time I have encountered such a problem. When I didn’t specialize in Linux when I saw these instructions in a few months, I was confused. Now I see the same thing, but at least I am not completely confused. Maintaining learning is the best strategy.
In addition, the biggest problem I found during the search wasProblem-oriented search replaces knowledge-oriented search, just think that you can solve the problems you encounter through the articles you have searched, which is OK for the problem of searching documents. However, once you enter the level of high basic knowledge, practicing various methods with ignorance of tools will be extremely time-consuming and may lead to larger problems. Even if it is finally solved, ignorance of using tools will continue to bring the same problems in the later stage.
The only way is to make sure you understand these tools, and it took me a long time to find out that I should go directly to search.vmhgfs-fuse
How to use it instead of how to solve itThe shared folder of Linux virtual machine cannot be opened
other
You can use the vmware-hgfsclient command to view which shared directories are currently available.
Reference (record the pits that have been struck by various methods)
/s/article/60262?lang=zh_CN (The person who tied the bell must also be able to untie it. Why don’t you ask the omnipotent official first?)
/f110300641/article/details/83714102 (It's much better than the few top junk articles I directly searched for. As expected, I can't just look at the popularity)