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 -mask -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

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!

Author: Joel Carnat

@work Technical Architect and SysAdmin ; @home OpenBSD and FOSS, Karate, Kobudō, Jōdō, Bodyweight workout, Photography & Music

2 thoughts on “Enable NFS daemon on Mac OS X Lion”

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

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.