10

I have installed an NFS File Server on Ubuntu 11.10, and that is working well.

I am only able to connect to the NFS server from my Mac with this command:

 mount -t nfs -o vers=4 10.0.10.26:/srv /Users/admin/Desktop/mount

But I cannot connect via Finder (nfs://10.0.10.26:/srv) or through any third party programs that don't allow for the version parameter. The Syslog error is

mount_nfs: can't mount /srv from 10.0.10.26 onto /Users/admin/Desktop/mount: Program version wrong

Is there any way to set this to V4 by default? Either server side or on my Mac? I need to be able to connect without the extra parameters.

Thanks

3 Answers 3

14

Hmmm, seems we need to have this question re-answered every major release of OS X.

So I can only say this works on 10.10.x :)

From OS X's man page for mount_nfs

"nfs.conf(5) can be used to configure some NFS client options. In particular, nfs.client.mount.options can be used to specify default mount options"

To get the Finder to default to using NFS v4 add the following to /etc/nfs.conf using the terminal command "sudo vi /etc/nfs.conf"

 nfs.client.mount.options = vers=4

Again, to check after mounting use "nfsstat -m" and check the "NFS parameters".

1
  • Still works for 10.13 High Sierra, too. Commented Jan 18, 2020 at 17:58
11

The syntax for using NFS v4 (and passing options in general) is :

nfs://vers=4,10.0.10.26/srv

You can check the mount afterwards from the Terminal using :

nfsstat -m
3
  • I found (OSX 10.9.5) that this was no good. The comma ends up in the mount command. Investigating the command it ran (from the ps list) I saw that this resulted in a command: mount_nfs -odeadtimeout=45 nfsvers=2,example.com:/var/www /Volumes/www - which was a failure. Experiments with other variations of spacing before the hostname seemed to help a little. Entering an nfs URL nfs:// -onfsvers=2 example.com:/var/www - Including those spaces looked like it should have worked, but for some reason still did not.
    – dman
    Commented Dec 10, 2014 at 2:13
  • Can confirm that this work even on Ventura 13, and seems less hacky than applying changes to environment files.
    – jhaavist
    Commented Nov 21, 2022 at 13:43
  • This doesn't seem to work on Sonoma 14.
    – Quantum7
    Commented Nov 13 at 9:05
1

I know this is an old question, I just wanted to note for current users that under Big Sur I am able to use

nfs://vers=4,myhost.mydomain.com/nfs/share

3
  • Definitely doesn't work for me. Any special setup that you did beforehand?
    – dimitarvp
    Commented Jan 5, 2021 at 2:01
  • Same here. I get mount_nfs: warning: option "nfssvers" not known Commented Jun 5, 2021 at 11:35
  • I was not clear, sorry about that! That syntax works in the "Connect to Server" dialog of the Finder, not as parameters to mount at the command line. Commented Jun 7, 2021 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .