Enable NFS daemon on Mac OS X Lion

Mac OS X is build on UNIX. As such, it should be able to export it’s data using NFS. Although I couldn’t find the GUI to enable it, it can be done via the Terminal.

Start a Terminal and edit (or create) the “exports” file to configure the filesystem to be remotely accessible:

# sudo vim /etc/exports /Users -alldirs -network 192.168.0.0 -mask 255.255.255.0 -mapall=ptijo

This allows me to mount any user’s directory and to map the remote UID with the local “ptijo” user. This is needed since UID on my MacBook have nothing in common with the ones in my UNIX servers. Note that this is a security hole so don’t do it unless you know you can access to your files…

Once configured, just start the NFS dæmon and check that it works.

# sudo nfsd start Starting the nfsd service # sudo nfsd status nfsd service is enabled nfsd is running (pid 16709, 8 threads)

From your UNIX client, verify that you can access the mount points:

# sudo showmount -e macbook.tumfatig.net Exports list on macbook.tumfatig.net: /Users 192.168.0.0

Mount it the “usual” way.

# sudo mount -t nfs macbook.tumfatig.net:/Users/ptijo /mnt

When you have done with your transfers, unmount the filesystem and turn the NFS dæmon off:

# sudo nfsd stop Stopping the nfsd service (use 'disable' to make permanent)

That’s All Folks!

2 Comments

  • Philippe Valentin Thu, 24 Oct 2013 21:00:06 +0000 Reply

    Hello, thanks for this post.
    Well, I don’t understand why you export /Users and afterwards on the client side you mount /Users/ptijo
    Anyway, it does not work for me despite a very traditional setup (I have never used NFS on Mac and I get the regular “access denied by server” on the Mac side.

    • Joel Carnat Fri, 20 Dec 2013 09:30:28 +0000 Reply Author

      It’s been a long time since I did this. But as far as I remember, the idea was to access /Users/ptijo (on Mac OS X) from some other remote system.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

%d bloggers like this: