MacOS – Set Default NFS v4 when connecting from Mac OS X Lion

macosnfs

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

Best Answer

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".