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 192.168.1.0 -mask 255.255.255.0
vikas@Vikas-MacBook-Pro:~$

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:~$
vikas@Vikas-MacBook-Pro:~$ nfsd status
nfsd service is enabled
nfsd is running (pid 127, 8 threads)
vikas@Vikas-MacBook-Pro:~$

On Kickstart Server (Virtual Machine)

Append something like below in /etc/fstab

## Mount ISO Share
192.168.1.1:/Users/vikas/Documents/ISOs /ISOs nfs defaults,_netdev 0 0

## RHEL
/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

## UBUNTU
/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