Enable NFS daemon on Mac OS X Lion

       224 words, 2 minutes

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=jca

This allows me to mount any user’s directory and to map the remote UID with the local “jca” 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/jca /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!