A while ago I covered netbooting/installation on ubuntu, well I’ve now found an even easier way to do this! It’s probably the easiest way to go about this as it really only involves editing one config file. Some of the info here comes from the official Ubuntu documentation on this, though my approach is actually easier, since you don’t need a separate tftp server.
The main piece of software you will need is dnsmasq, which you can install with the command:
sudo apt-get install dnsmasq
I already had this installed as I’m using it as a DNS cache for my network (which is also pretty useful). It turns out that dnsmasq is a bit of a ‘swiss army knife’, it can do DHCP, DNS and TFTP all together and very easily. You should edit the config file:
sudo nano /etc/dnsmasq.conf
And add/uncomment/edit the following lines:
dhcp-range=192.168.1.3,192.168.1.50,12h # sets the ip address range and update frequency for the network
dhcp-boot=pxelinux.0 # set up network booting to boot the pxelinux bootloader
enable-tftp # enable built in tftp server
tftp-root=/var/tftpd # set tftp directory
Basically this sets up dnsmasq to be both the DHCP server for the network and push the PXE boot options out over the network. It also enables the built in TFTP server in dnsmasq and sets the directory to serve files from.
The next step is to get some files to serve, I got the PXE/netboot image from the Ubuntu cdimages site, and untarred the files to the correct directory:
sudo mkdir -p /var/tftp
tar -xvzf netboot.tar.gz -C /var/tftp/
chown -R nobody:nogroup /var/tftp
The tar file of course is basically just the minimal install CD, set up for netbooting, so when you install you will need to download all the packages, for a simple cli install this doesn’t take very long, and you can use a package cache or something to help with future installs.
OK, now restart dnsmasq:
sudo /etc/init.d/dnsmasq restart
…and you should be good to go (make sure that your machine is the only DHCP server on the network). For tips on booting clients see my original article – btw, since I used the new version of Ubuntu I can now boot my Eee PC 901 over the network!
If you have any questions or problems with this I’d be happy to answer them, just post them below.
Bye for now!