VMware Communities
bkorb
Contributor
Contributor

How do I share a directory with a UNIX VM?

I did go through the menu and my Linux VM saw this weirdo "/mnt/hgfs" thing.

But it does not support hard links.  POSIX requires file systems to support hard

links, the underlying OS/X file system does and the various normal Linux

file systems do.  "hgfs" does not.  That is utterly inexcusable.  Meanwhile,

I *must* have a shared file system that supports hard links:  NFS.

So, my OS/X has a /etc/exports file with the most  permissive settings I know how to make.

My VM can see the NFS export just fine.  "showmount -e 10.0.0.120" shows it just fine.

But when I try to mount the blasted thing, I get "access denied by server" with or without

the "vers=3" option.  (Apple being really, really, really slow to the NFSv4 table.)

Has anybody actually solved this?  It surely seems like a common thing folks would want to do.

0 Kudos
6 Replies
hqasem
Contributor
Contributor

Just a thought. Do you have a Firewall running on your NFS server? If so, you need to either:

  • Turn off the firewall.
  • Allow NFS through the Firewall: NFS (Port 2049 TCP/UDP), Portmapper (Port 111 TCP/UDP), and Mountd (Port [configurable] UDP)

I would turn off the firewalls on both ends first to get it to work, and then enable the firewalls again.

Hope this helps.

0 Kudos
bkorb
Contributor
Contributor

Thank you, but no, that isn't the problem.  I can NFS mount the directory from another UNIX box that is not a VM (viz. physically external to the OS/X platform).  So, OS/X is properly sharing the directory and it is not blocking access.  It is to do with the VM network inside the OS/X box.

0 Kudos
wila
Immortal
Immortal

I can NFS mount the directory from another UNIX box that is not a VM (viz. physically external to the OS/X platform).  So, OS/X is properly sharing the directory and it is not blocking access.  It is to do with the VM network inside the OS/X box.

One does not exclude the other. Your OS/X can still be blocking access to your VM.

See this article here: ESX NFS storage on linux

It's for setting up an NFS share for ESX, but the global steps still apply, although you shouldn't need to set things up like root_squash.

As you can see there, you can specify which hosts can connect using the hosts.allow file.

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
bkorb
Contributor
Contributor

Thank you.  That helped point me in the right direction.

<pre>

$ rpcinfo -p 127.0.0.1|grep -w 111

100000  2 tcp 111 portmapper
100000  2 udp 111 portmapper

</pre>

It is an OS/X issue:  they only support NFSv2 and the client OS only supports v3 and v4.

v4 is too new:  it is only about a decade old.  Apple needs more time.

So, the answer is one of:

  1. Coerce OS/X into a more modern NFS, or
  2. Host the NFS on another machine, though that means I cannot keep it with me with my laptop. (My other machine being very non-portable.)

So thank you for getting me pointed the right direction.  Regards, Bruce

0 Kudos
wila
Immortal
Immortal

I'm glad to hear that you read the article long enough to find the troubleshooting session as I did forget to mention that.

That seems to be very weird, why would apple only support version 2 NFS? It's not like they don't get version 3 for free or that it isn't released for many many years.

When I look at this article NFS Server on OS/X then it appears that only portmapper is version 2.

Somewhere else I also read that if you add "-o vers=3" in the mount command (or add 'vers=3' to the options field in fstab) that you will force it to mount as version 3. There might be syntactical differences as somewhere else I see it mentioned as "-o nfsvers=3" so check your linux distro using man mount.

Hope this helps,

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
bkorb
Contributor
Contributor

The portmapper results were on the server, meaning that it only exported version 2.  I would need to find an NFS v3 or 4 server that ran on OS/X before I could use the "-o ver3" option on the client side.  I tried the option early on, but it did not work and now I know why.  My openSuSE server exports all three versions (2, 3 and 4) and the client on my VM negotiates the best deal (v4).

I also have some doubt that portmapper is the cause.  It will report whatever gets registered.  If a v3 capable service registers v3 of its interface, portmapper will happily report it.  If the 10.7 (tiger? leapord? whatever.  "uname -r" says "10.7.4" and all the various help articles presume folks know what it means) the 10.7 version of the NFS server is v3 capable, it isn't registering it.  Adding "-o ver3" on the client won't help.  I guess I need some server side option that says, "advertise all of your capabilities".

In the end, it is inexcusable that this is this hard.  But it is an Apple issue, not a VMware issue.  The VMware issue is the file system that does not support hard links.  That is dumb.

0 Kudos