How to configure VMware Tools Shared Folders Linux mounts
search cancel

How to configure VMware Tools Shared Folders Linux mounts

book

Article ID: 313233

calendar_today

Updated On:

Products

VMware Desktop Hypervisor

Issue/Introduction

This article provides steps to configure VMware Tools Shared Folders Linux mounts

Resolution

Recent releases of VMware Tools for Linux support two types of VMware Shared Folders client for Linux operating systems.

1. Kernel mode client file system type vmhgfs
2. User mode client FUSE file system type vmhgfs-fuse

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>
  1. Replace <file system> with vmhgfs-fuse.
  2. Replace <mount point> with the local file system on which the exported directory is mounted, which default replacement is to use /mnt/hgfs
  3. Replace <type> with fuse.
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>
  1. Replace <server> with the hostname .host the shared folders name of the host server exporting the hosts file system.
  2. Replace </remote/export> with the path to the exported directory which defaults to/or you can use the /share-name-you-created.
  3. Replace </local/directory> with the local file system on which the exported directory is mounted, which defaults to /mnt/hgfs.
  4. Replace <fuse-type> with fuse.vmhgfs-fuse.
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,

  1. Ensure the root account is enabled, and the password is known.
  2. Test the mount with any specified options using a terminal window, run the command with the default and additional options

Example:
/usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other<,additional options>

  1. If the Linux OS supports the "nofail" option, appending "nofail" to the fstab mount options field for the shared folder entry, the boot process will continue even if a drive fails to mount for any reason.

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