After you enable a shared folder, you can mount one or more directories or subdirectories in the shared folder to any location in the file system in addition to the default location of /mnt/hgfs.

Depending on the kernel version of the Linux guest operating system, VMware Tools uses different components to provide shared-folder functionality. In Linux kernels prior to version 4.0, the VMware Tools services script loads a driver that performs the mount. Linux kernels 4.0 and later use a FUSE file system component.

You can use different mount commands to mount all shares, one share, or a subdirectory within a share to any location in the file system. The commands also vary depending on the Linux-kernel version of the guest.

Table 1. Mount Command Syntax

Linux Kernel Prior to 4.0

Linux Kernel 4.0 and Later

Description

mount -t vmhgfs .host:/ /home/user1/shares

/usr/bin/vmhgfs-fuse .host:/ /home/user1/shares -o subtype=vmhgfs-fuse,allow_other

Mounts all shares to /home/user1/shares

mount -t vmhgfs .host:/foo /tmp/foo

/usr/bin/vmhgfs-fuse .host:/foo /tmp/foo -o subtype=vmhgfs-fuse,allow_other

Mounts the share named foo to /tmp/foo

mount -t vmhgfs .host:/foo/bar /var/lib/bar

/usr/bin/vmhgfs-fuse .host:/foo/bar /var/lib/bar -o subtype=vmhgfs-fuse,allow_other

Mounts the subdirectory bar within the share foo to /var/lib/bar

For Linux kernel prior to version 4.0, you can use VMware-specific options in addition to the standard mount syntax. Enter the command /sbin/mount.vmhgfs -h to list the options.

For Linux kernel version 4.0 or later, enter the command /usr/bin/vmhgfs-fuse -h to list the available options.

Note:

The mount can fail if shared folders are disabled or if the share does not exist. You are not prompted to run the VMware Tools vmware-config-tools.pl configuration program again.