Setting up a PXE boot server under Ubuntu Hardy

I thought I'd put this little how-to together since I seem to need a PXEBoot server every once in a while. I have a Motion M1300 TabletPC with no external CD drive so I use my trusty linux box as a PXE server to install different distros to the tablet. This might be something somebody else out there might find useful so here's how to setup a PXE boot server on Hardy with a couple different linux distros.

First step we need to do is install the right packages on our Hardy box. Fire up a terminal and type:

$ sudo aptitude install lftp tftpd-hpa dhcp3-server openbsd-inetd

Now we need to configure the tftp server. Edit the config file with your favorite editor (mine's VI):

$ sudo vi /etc/inetd.conf

Add the following line:

tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot

Now add this configuration to /etc/default/tftpd-hpa:

RUN_DAEMON="yes" OPTIONS="-c -s /var/lib/tftpboot"

Now it's time to start the daemon from the terminal:

$ sudo /etc/init.d/tftpd-hpa start

Make sure it's running:

$ netstat -lu | grep tftp

You should see one line:

udp 0 0 *:tftp *:*

Now we need to configure the dhcp server:

$ sudo vi /etc/dhcp3/dhcpd.conf

Here's what I have in my file:

option domain-name-servers;
default-lease-time 86400;
max-lease-time 604800;
subnet netmask {
    filename "pxelinux.0";
    option subnet-mask;
    option broadcast-address;
    option routers;

Note that I'm on subnet 10.0.1.* and my router is at Make sure your config file is setup with your own network configuration. Start the dhcp server:

$ sudo /etc/init.d/dhcp3-server start

And verify that it's running:

$ ps ax | grep dhcpd

Now we need to download the netboot files from the distros we want to be able to boot. I'll just go through Ubuntu Hardy. Navigate to the tftpboot directory and download the hardy netboot files:

cd /var/lib/tftpboot/

lftp -c "open; mirror"

Now boot up the client computer (making sure it's set to PXE boot) and you should be presented with the Hardy installer screen. To boot other distros, download the netboot files for them into the same directory, edit pxelinux.cfg/default to add the other kernels, and edit boot.txt with the alias you gave the distro in the default config file.


Published: July 28, 2008

Author: jmhobbs

Word Count: 461



  • Tag Cloud


    Copyright © 2015 Jared Hobbs. All rights reserved. Powered by Pelican. The Hobbs Family theme available here.