NFS on Mac OS X

My Ubuntu Kickstart Virtual Machine relies a lot on NFS for sharing ISO images from Mac OS X to the Kickstart Virtual Machine. Some people copy large ISO files to the VMs which I believe is not a good idea, waste of time and disk space.

This is a short and sweet post of how I share various Linux distros ISO files with my kickstart server. And if you run out of loop devices check out this post.

I have kept all my ISO files under /Users/vikas/Documents/ISOs and made my Mac as a NFS Server and my kickstart virtual machine as NFS client.

On Mac OS X

Create a file to be read by NFS daemon. Syntax is slightly different than Linux.

vikas@Vikas-MacBook-Pro:~$ cat /etc/exports
/Users/vikas/Documents/ISOs -maproot=root:wheel -network -mask

Enable and start the NFS Service

vikas@Vikas-MacBook-Pro:~$ sudo nfsd enable
vikas@Vikas-MacBook-Pro:~$ sudo nfsd start
Starting the nfsd service
vikas@Vikas-MacBook-Pro:~$ nfsd status
nfsd service is enabled
nfsd is running (pid 127, 8 threads)

On Kickstart Server (Virtual Machine)

Append something like below in /etc/fstab

## Mount ISO Share /ISOs nfs defaults,_netdev 0 0

/ISOs/UNIX/LINUX/64-Bit/rhel-server-5.10-x86_64-dvd.iso /var/lib/tftpboot/distros/RHEL_5.10_64  iso9660 loop,_netdev 0 0
/ISOs/UNIX/LINUX/64-Bit/rhel-server-6.5-x86_64-dvd.iso  /var/lib/tftpboot/distros/RHEL_6.5_64   iso9660 loop,_netdev 0 0

/ISOs/UNIX/LINUX/64-Bit/Debian_Based_Distros/ubuntu-14.04-desktop-amd64.iso /var/lib/tftpboot/distros/UBUNTU_Desktop_14.04 iso9660 loop,_netdev 0 0

Hope this helps someone. Thanks.

comments powered by Disqus