Connect to an NFS share on Ubuntu from OS X Leopard

This is another note to myself in case I forget. I still have a server at home running Ubuntu and I have a few shared directories through NFS. NFS support is built into OS X but there's some things you need to do on the server side to be able to connect correctly.

First of all, I'm assuming your NFS shares are all correctly setup and working. Maybe another day I'll write up a short tutorial on how to get that up and running. Anyway, to be able to connect correctly from OS X, some UID and GID maps need to be established. (Since your user and group IDs are most likely different on your linux and OS X boxes). Without setting this up correctly, you'll most likely get an error similar to incorrect username and password. To fix this, you simply need to add an entry to /etc/exports and add a static map somewhere (I put the maps in /etc/nfs).

Here's a sample entry from my /etc/exports file:

/mnt/fileshare wario(rw,async,insecure,map_static=/etc/nfs/wario.map)

/mnt/fileshare koopa(ro,async,insecure,map_static=/etc/nfs/koopa.map)

These two lines let both wario and koopa (both of these are the hostnames for two different Leopard boxes) access the directory /mnt/fileshare over NFS, but only wario has read-write access (koopa has read-only access).

The contents of wario.map and koopa.map contain the UID and GID of my accounts on the OS X boxes mapped to the UID and GID of my account on the linux box. To find out your uid and gid on both OS X and linux, open up a terminal and type id. Here's what wario.map looks like:

# remote local uid 501 1000 gid 20 1000

After making these changes, restart the nfs server and you should be able to connect to the linux NFS shares from Leopard without any problems!

(Command+K, nfs://server/path/to/share).

Meta

Published: January 05, 2009

Author: jmhobbs

Word Count: 338

Tags

linux mac ubuntu

  • Tag Cloud

  •  

    Copyright © 2015 Jared Hobbs. All rights reserved. Powered by Pelican. The Hobbs Family theme available here.