This article provides steps to configure VMware Tools Shared Folders Linux mounts
Recent releases of VMware Tools for Linux support two types of VMware Shared Folders client for Linux operating systems.
Both types of client require different commands to manually configure the default mounts.
If a user enables the Shared Folders feature from UI, the VMware Tools for Linux will create a default mount in the Linux guest using the default options and will automatically handle the type of client supported for the installed version of Linux.
The default options will mount all shares for all guest users under the default mount point which will be at the location: “/mnt/hgfs”
For users that would like to specify different or additional options to the defaults they must know which Shared Folders client is installed and in-use to correctly configure the client.
How to determine which Shared Folders client is in use:
For VMware Tools 10.3.0 and newer, the Shared Folders FUSE client will be in use for Linux kernel version 3.10 and newer.
For VMware Tools 10.0.0 and newer, prior to version 10.3.0, the Shared Folders FUSE client will be in use for Linux kernel version 4.0.0 and newer.
In the above cases, where the FUSE client is not used, the kernel mode client will be used instead.
For VMware Tools released prior to 10.0.0, only the kernel mode client is used and is not expected to be used on Linux kernel version 4.0.0 and newer.
How to configure the Shared Folders client
The following will configure the Shared Folders clients with the default options:
For VMware Tools - Shared Folders kernel mode client use the following mount command:
mount -t vmhgfs .host:/ /mnt/hgfs
For VMware Tools - Shared Folders user mode FUSE client use the following mount command:
/usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
For specifying a single shared folder called mysharedfolder instead of all under the general mount point a user can use the following commands:
For VMware Tools - Shared Folders kernel mode client use the following mount command:
mount -t vmhgfs .host:/mysharedfolder /mnt/hgfs
For VMware Tools - Shared Folders user mode FUSE client use the following mount command:
/usr/bin/vmhgfs-fuse .host:/mysharedfolder /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
If a user wishes to configure the Shared Folders mount with other mounting options they should refer to the standard Linux man pages for mount and FUSE respectively.
Persistent Mounts
There are 2 ways to specify the Shared Folders mounts persistently in /etc/fstab.
It is recommended to take the snapshot of the Virtual Machine before modifying the system file.
Below there are both samples /etc/fstab line to mount a FUSE vmhgfs export.
Method 1: Specifying the file system
<file system> <mount point> <type> <options> <dump> <pass>
Example:vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0
Method 2: Specifying the remote server and share
<server>:</remote/export> </local/directory> <fuse-type> <options> <dump> <pass>
Example:
.host:/ /mnt/hgfs fuse.vmhgfs-fuse defaults,allow_other 0 0
Note: Using either of the above formats should be fine. When modifying the system file to add a persistent boot for the Shared Folders, it is essential to consider how to handle any failures. Some versions of Linux will fail to boot if a mount fails, which can occur if the Shared Folders is disabled or options are not correctly specified for the fstab entry.
To prevent or recover from this issue,
Example:
/usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other<,additional options>
Example if an unknown option, ttl=5, is set:
.host:/debian-test /mnt/hgfs/debian-tst fuse.vmhgfs-fuse defaults,ttl=5,allow-other,nofail 0 0