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-fuse
service is instead called vmblock-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