Dec 29
Creating an NFS share on Ubuntu to allow access from Mac OS X
I have a few Ubuntu servers and find it useful to have easy file access from my Mac workstation. To make this possible, I have setup my Ubuntu servers as NFS server, and the Mac as NFS client. This is how I did it:At the Ubuntu side
Install the NFS server support:
sudo apt-get install nfs-kernel-server nfs-common portmap
Then, edit the exports file that controls the file systems (or simply the directories) that can be exported to clients.
sudo vi /etc/exports
I want to make all exports available to all client on my network, so here's my exports file:
# /etc/exports: the access control list for filesystems which may be exported# to NFS clients. See exports(5).## Example for NFSv2 and NFSv3:# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)## Example for NFSv4:# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)#/home/peter 192.168.110.0/24(rw,insecure)
The directive "insecure" is there to allow for correct (RW) connectivity with the Mac OS X client. You may also need to tweak the file/folder permissions on the NFS server to allow for the desired level of access on the client. This is because the client user who is connected to the NFS server does not map accurately.
Then, restart the NFS service:
sudo /etc/init.d/nfs-kernel-server restart
If you get something like this, everything is well:
* Stopping NFS kernel daemon...done.* Unexporting directories for NFS kernel daemon......done.* Exporting directories for NFS kernel daemon...exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.110.0/24:/home/peter".Assuming default behaviour ('no_subtree_check').NOTE: this default has changed since nfs-utils version 1.0.x...done.* Starting NFS kernel daemon...done.
At the Mac side
In Finder, click Go --> Connect to Server, and in the server address field type:
nfs://192.168.110.114/home/peter/
It should take less than a second to connect, and the NFS drive will appear in the list of shares in a Finder window.
