Setting up an NFS share between a virtual Parallels Ubuntu server and OS X Mountain Lion

Parallels upto now has made my life very easy for virtualisation. Instances run fast, don’t slow down the mac and setting up shared directories so remote server and host can see the same application files works flawlessly. Until today that is…

Today I need to setup Symfony2. During it’s setup, config and running it uses a combination of cli and web tools which did not get on with my usual shared directory setup. I could either get it running on the mac without the ubuntu server able to see it or working on ubuntu without the IDE on the mac able to see it.

The solution turned out to be simple – NFS to the rescue!

On the mac to setup the NFS server edit the /etc/exports file to specify the directory to share and the network range that can see it. Most importantly is  -mapall=root:wheel which ensures that all client writes appear as root, so there are no permission hassles on the client end.

UPDATE: on using this method to share a system directory on another project the share failed, so it may not be possible to use this option in all cases.

 

At the client end create a mount point and mount:

And for good measure add into /etc/fstab