'vmhgfs-fuse at boot with VMware Windows 8.1 host and Ubuntu 16.04 guest
I am using the VMware Player with a Windows 8.1 host and an Ubuntu 16.04 guest and I have a shared folder shared_folder that I want to mount to a specific location at boot: /shared_folder. I can manually do that using the command
vmhgfs-fuse .host:/shared_folder /shared_folder
Now I would like to do that automatically during boot. Since I am a beginner with Ubuntu, maybe someone can point me to the solution of my problem. Thanks
Solution 1:[1]
So after half a day of googling, try-and-error, 5mins after I post this question I find a working solution.
I added the following line to /etc/fstab:
.host:/shared_folder /shared_folder fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
Which sets the options (sources: vmhgfs-fuse --help and man fstab):
allow_other"allow access to other users"uidandgidthe user and group ID to set for filesauto_unmount"auto unmount on process termination"defaults"use default options: rw, suid, dev, exec, auto, nouser, and async."
Solution 2:[2]
I am running CentOS 7 but this handy ArchLinux doc saved me. I had tons of permission issues with Apache in a shared folder, and after hours of digging, I was able to enable the mount as a systemd service. After reboot all is well.
Create a service for the directory you want to mount:
$ sudo touch /etc/systemd/system/<shared folders root directory>-<shared_folder>.service
Using a text editor, set the service's contents to the following, replacing each <...>.
[Unit]
Description=Load VMware shared folders
Requires=vmware-vmblock-fuse.service
After=vmware-vmblock-fuse.service
ConditionPathExists=.host:/<shared_folder>
ConditionVirtualization=vmware
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/vmhgfs-fuse -o allow_other -o auto_unmount .host:/<shared_folder> <shared folders root directory>
[Install]
WantedBy=multi-user.target
NOTE: On openSUSE, the
vmware-vmblock-fuseservice is instead calledvmblock-fuse.service.
Make sure <shared folders root directory> exists as the systemd service depends on it.
$ mkdir -p <shared folders root directory>
Finally, enable the service.
$ sudo systemctl enable <shared folders root directory>-<shared_folder>.service
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Luc |
| Solution 2 | Peyton |
