20110122

Howto: Share a directory between a Mac OS X machine and Ubuntu over NFS

Today I needed to share a directory between my macbook and a ubuntu virtual machine, I'll show you how. The main idea is to share the directory from my mac and then mount it in the linux machine. This is done using nfs, and here are the steps:

In our mac, open a Terminal and edit /etc/exports:

sudo vi /etc/exports
Add a line with the directory you want to share, and the network you want to grant access, in this case 192.168.0.0/16
/directory_to_share/ -network 192.168.0.0 -mask 255.255.0.0
Restart nfsd service (maybe you should enable this service with: sudo nfsd enable)
sudo nfsd restart
Check if everything is correct
showmount -e
After this you can mount that directory over nfs in another machine, to do this on Linux:

Check if you can reach the Mac and see the exported directories:
showmount -e my_mac_ip_address
If you see the directory in the list you can try to mount it:
sudo mount my_mac_ip_address:/directory_shared/ /mount_point/

Thats all the magic..

No hay comentarios.:

Publicar un comentario