2016年10月5日 星期三

Mounting Shared Folders in a Linux Guest

Mounting Shared Folders in a Linux Guest

After you have enabled 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.
Use the mount command to mount all shares, one share, or a subdirectory within a share to any location in the file system.
Mount Command Syntax
Command
mount -t vmhgfs .host:/ /home/user1/shares
 Description
Mounts all shares to /home/user1/shares
mount -t vmhgfs .host:/foo /tmp/foo
Mounts the share named foo to /tmp/foo
mount -t vmhgfs .host:/foo/bar /var/lib/bar
Mounts the subdirectory bar within the share foo to /var/lib/bar
You can use VMware-specific options in addition to the standard mount syntax. For usage information for the host-guest file system options, type the command /sbin/mount.vmhgfs -h.
When you install VMware Tools, an entry is made to etc/fstab to specify the location of shared folders. You can edit this file to change or add entries. For example, to auto-mount at startup, edit /etc/fstab and add the line:
.host:/ /mnt/hgfs vmhgfs defaults 0 0
The VMware Tools services script loads a driver that performs the mount. If the mount fails, a message appears regarding mounting HGFS shares.
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.

=============================
id  apache
uid=48 gid=48 groups=48cat
===================
cat /etc/fstab
/dev/mapper/centos-root /                                                          xfs             defaults      0 0
UUID=52fe9b71-332b-455f-b8eb-525600df7a3a  /boot       xfs              defaults     0 0
/dev/mapper/centos-swap                                         swap    swap             defaults     0  0
./host:/   /mnt/hgfs      

沒有留言:

張貼留言