Friday, 31 July 2015

VMware Shared Folders - Now why did I not know that ?

I'm digging into VMware Shared Folders using Fusion on one of my Macs.

Specifically, I was trying to work out how to mount a Shared Folder called Repository as /Repository within the Red Hat Enterprise Linux guest, rather than having it appear as /mnt/hgfs/Repository.

Whilst there's nothing wrong with the default, it does tend to get in the way of scripts, and appears inconsistent when compared with a non-Fusion environment.

This article: -

on led me here: -

/sbin/mount.vmhgfs -h

Usage: mount.vmhgfs <sharename> <dir> [-o <options>]
Mount the HGFS share, specified by name, to a local directory.
Share name must be in host:dir format.

  ro                    mount read-only
  rw                    mount read-write
  nosuid                ignore suid/sgid bits
  suid                  allow suid/sgid bits (default)
  uid=<arg>             mount owner (by uid or username)
  gid=<arg>             mount group (by gid or groupname)
  fmask=<arg>           file umask (in octal)
  dmask=<arg>           directory umask (in octal)
  nodev                 prevent device node access
  dev                   allow device node access (default)
  noexec                prevent program execution
  exec                  allow program execution (default)
  sync                  file writes are synchronous
  async                 file writes are asynchronous (default)
  mand                  allow mandatory locks
  nomand                prevent mandatory locks (default)
  noatime               do not update access times
  atime                 update access times (default)
  nodiratime            do not update directory access times
  diratime              update access directory times (default)
  ttl=<arg>             time before file attributes must be
                        revalidated (in seconds). Improves
                        performance but decreases coherency.
                        Defaults to 1 if not set.
  bind                  perform bind mount
  bind                  move an existig mount point
  serverino             Use server generated inode numbers.
  noserverino           Use client generated inode numbers.
  remount               remount already mounted filesystem

This command is intended to be run from within /bin/mount by
passing the option '-t vmhgfs'. For example:
  mount -t vmhgfs .host:/ /mnt/hgfs/
  mount -t vmhgfs .host:/foo /mnt/foo
  mount -t vmhgfs .host:/foo/bar /var/lib/bar

This allowed me to do THIS: -

mkdir /Repository
mount -t vmhgfs .host:/Repository /Repository/
ls -al /Repository/

total 17
drwxr-xr-x   1 db2inst1 games  408 Jul 31 10:57 .
dr-xr-xr-x. 26 root     root  4096 Jul 31 19:19 ..
drwxr-xr-x   1 db2inst1 games  374 May 31  2014 BAM
drwxr-xr-x   1 db2inst1 games  306 May 30  2014 BPM
drwxr-xr-x   1 db2inst1 games  102 Jul 31 07:32 DB2
drwxr-xr-x   1 db2inst1 games  136 Jul 31 10:57 Fixes
drwxr-xr-x   1 db2inst1 games  102 Jul 31 07:33 IIB
drwxr-xr-x   1 db2inst1 games 1054 Jul 31 11:05 IIM
drwxr-xr-x   1 db2inst1 games  136 Jul 31 07:46 ODM
drwxr-xr-x   1 db2inst1 games  340 Jul 31 13:11 ResponseFiles
drwxr-xr-x   1 db2inst1 games  510 Jul 31 07:37 WAS
drwxr-xr-x   1 db2inst1 games 1360 Jul 31 07:48 WMQ

which is precisely what I want.

For the record, this is what I've got configured in VMware Fusion Professional 7.1.2: -

and this is what I've got on the host Mac: -

total 0
drwxr-xr-x  12 hayd  staff   408 31 Jul 10:57 .
drwxr-xr-x  20 hayd  staff   680 31 Jul 07:34 ..
drwxr-xr-x@ 11 hayd  staff   374 31 May  2014 BAM
drwxr-xr-x@  9 hayd  staff   306 30 May  2014 BPM
drwxr-xr-x   3 hayd  staff   102 31 Jul 07:32 DB2
drwxr-xr-x   4 hayd  staff   136 31 Jul 10:57 Fixes
drwxr-xr-x   3 hayd  staff   102 31 Jul 07:33 IIB
drwxr-xr-x  31 hayd  staff  1054 31 Jul 11:05 IIM
drwxr-xr-x   4 hayd  staff   136 31 Jul 07:46 ODM
drwxr-xr-x  10 hayd  staff   340 31 Jul 13:11 ResponseFiles
drwxr-xr-x  15 hayd  staff   510 31 Jul 07:37 WAS
drwxr-xr-x  40 hayd  staff  1360 31 Jul 07:48 WMQ

No comments: