vmhgfs-fuse at boot with VMware Windows 8.1 host and Ubuntu 16.04 guest
Asked Answered
C

2

19

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

Chordophone answered 3/8, 2016 at 7:36 Comment(0)
C
44

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"
  • uid and gid the user and group ID to set for files
  • auto_unmount "auto unmount on process termination"
  • defaults "use default options: rw, suid, dev, exec, auto, nouser, and async."
Chordophone answered 3/8, 2016 at 7:45 Comment(5)
In my case, the allow_other has solved a perms problem. uid and gid were 0 (root) until I used that parameter (obviously I was using uid=1000 and gid=1000).Happygolucky
That to your half a day of googling and try-and-error, you saved me going through the same pain. Your solution was exactly what I was looking for. :-)Evaporimeter
Thank you! Very helpful. I did end up wasting an hour before reaching this page :(Chaldean
WARNING! Adding removable resources to fstab may lead to boot problemsGentleness
added entries to fstab can (and should) be tested with sudo mount -a and sudo umount -a before rebooting the systemPerspicuity
L
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-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
Luciusluck answered 28/12, 2016 at 17:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.