Ubuntu Reference Guide

part of the WillPowered Inc. network
© 2011 William Hall <5/> - This site uses HTML5


First you must install the server packages.

$ sudo apt-get install portmap nfs-kernel-server

Now decide which directories to share using NFS.

$ sudo nano /etc/exports

Use the following lines to add NFS shares in a variety of styles.

/path/to/directory,insecure,async,no_subtree_check),insecure,async,no_subtree_check) /path/to/other/directory,insecure,sync,no_subtree_check)

These are read only examples, replace ro with rw to enable writing. Obviously mentioning IPs only really works if the target computers use static IPs. The insecure option means that NFS doesn't care about the user ID which makes Ubuntu to Mac NFS connections work much better.

To create NFS exports accessible to any computer use the following syntax:


Whenever you change the exports file, run the following command.

$ sudo exportfs -ra

For clients, you must install extra packages.

$ sudo apt-get install portmap nfs-common

I prefer to mount the NFS shares at boot so I add the following line to /etc/fstab.

ip.address.of.server:/path/to/share/on/server /mount/path nfs ro,soft,intr 0 0

Again, swap ro for rw if you want to write.

It is possible for an ubuntu installation to be both server and client.

Reference here