Prerequisites

Server: Synchronising users

Before you begin we need to setup your diskless users. On your server machine (the one that will run NFS-server). Take note of the user and group ID. If you need to create additional users Ubuntu server has the ever useful "useradd" command.

Note, my local IP range is 192.168.1.0/24 (aka 192.168.1.1-192.168.1.255). Change your to your local range. Alternatively use a wildcard. Be warned about no_root_squash. You are allowing remote users to write files as root on your system which is an excellent way to gain access to your server! Future updates to this guide will work around this flaw.

It is also worth noting that NFS can allow you to share certain folders depending on IP address or user so once again you can give different machines different workspaces to play with - very handy!

# Lets make the export available to our clients
sudo exportfs -rv

Server: Configuring TFTP

Under Ubuntu 11.10 server the TFTP package sets-up a default configuration. We need to reconfigure this file so TFTP runs as a daemon and points at the correct location.

Client: Preparing your client

Setup a standard Mint 12 environment. You may take this opportunity to install any additional applications or custom configurations. Be sure to add the same user(s) you did in the previous step. As before find out the user and group id of each remote user.

As you can see there is a mismatch. My user ID is 1001 on the remote client and the group ID is also 1001. You need to synchronise the setup with the server.

Log out of your user

Login as root(The rest of this guide assumes you are now running as root)

For each remote user enter the following

# You should now be logged in as root. Your subject user must be logged out of all sessions
usermod -u 1000 miles # where miles is your USER name
groupmod -g 1000 miles # where miles is your GROUP name
id miles # double check this took effect (see above)

Client: Making your client netboot ready

Warning: This will nuke your client install unless you revert changes after you are finished

Server: Setup your PXEConfig

Setup your netboot menu. Using the DEFAULT option as shown below will cause your netbooted machine to automatically boot straight into linux. There's nothing stopping you from switching it to a manual process. This file has lots of interesting options such as which IP can boot which bootfile - you could setup an entire suite of machines to boot different OS'. You can also have multiple options within this file, this is useful if you want to use net-install distributions (ie: installing Mint 12 to a local disk via PXE).

sudo vi /var/lib/tftpboot/pxelinux.cfg/default
LABEL mint12
DEFAULT vmlinuz-3.0.0-12-generic root=/dev/nfs initrd=initrd.img-3.0.0-12-generic nfsroot=192.168.1.180:/nfsroot,rw ip=dhcp rw
# vmlinuz** and initrd.img** should carry the same name as the step above. Your client kernel version may differ from mine so run the uname -r command on your client to find out what yours will is.

Now lets assign permissions to your TFTP folder

chmod -R 444 /var/lib/tftpboot # Allow read for all users

Now reboot your TFTP server

sudo restart tftp-hpa

Server: Configuring your DNSMasq Server

Add the following to your DNSMaq options.

dhcp-boot=pxelinux.0,nfs,192.168.1.180

If you are using DD-WRT login to your router. Click services. Under the heading DNSMasq make sure it is enabled. Paste the above into the "Additional DNSMasq Options" section. Within "Basic Setup" under the "Setup" tab make sure your router is using DNSMasq for DHCP and it is the authoritative server on your network (ie: the only DHCP server on your network). Apply settings.

Client: Reboot your machine!

Make sure your client machine (not VirtualBox as it doesn't seem to netboot correct at the time of writing) is set to network boot (PXE). Sometimes you may need to explicity select your network interface to boot.

If it was successful your adapter should attempt to lease an IP from DNSMasq then download the netboot information from your TFTP server. When that is complete Linux should take over and continue to boot via your NFS mount. Enjoy.