PXE Network Booting

PXE Network booting allows you to boot a computer over the network.
This means I can install an OS, or run a live cd on a computer that doesn't have a CD-ROM drive or Hard drive.
I can also install Ubuntu without needing to burn a CD every time.

It's pretty sweet.

I'm using Ubuntu Server 8.04 for my PXE server.
A PXE server consists of two things (Same for Windows based OSs):
* A DHCP server that hands out the correct info (In Windows DHCP management it's options 066 & 067)
* A TFTP server that shares the bootable files over the network.

I'm already running DHCP on my Octopus server for the home network. If you don't have DHCP you can install it with

sudo apt-get install dhcp3-server

And set it up by editing the config file:

sudo nano /etc/dhcp3/dhcpd.conf

You'll need to disable all other DHCP servers running on your network (i.e, DSL/Cable routers)

Here's my dhcpd.conf

subnet 192.168.10.0 netmask 255.255.255.0 {
        option domain-name "home.lan";
        option domain-name-servers 192.168.10.1; # DSL Router

        default-lease-time 600;
        max-lease-time 7200;

        range 192.168.10.150 192.168.10.200; # Range of addresses handed out

        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.10.255;
        option routers 192.168.10.1; # DSL Router

        filename "pxelinux.0"; # PXE Boot filename
        next-server 192.168.10.2; # PXE TFTP Server (which is this machine)
}

The important part for PXE is the "filename" and "next-server", which is the boot file and TFTP server, respectively.
Restart the DHCP server for changes to take affect:

sudo /etc/init.d/dhcp3-server restart

We also need a TFTP server -

sudo apt-get install tftpd-hpa

And we'll need to configure it:
sudo nano /etc/default/tftpd-hpa

Change to:
RUN_DAEMON="yes"
OPTIONS="-v -l -m /etc/default/tftpd.rules -s /var/lib/tftpboot"

The TFTP server gives out the files in /var/lib/tftpboot
So that's where we'll put the pxelinux.0 file and configuration.
You can get pxelinux.0 and such from the latest Ubuntu netinstall cd:
ftp://archive.ubuntu.com/ubuntu/dists/jaunty/main/installer-i386/current...

Download the following files to your TFTPBoot folder

cd /var/lib/tftpboot
wget -r ftp://archive.ubuntu.com/ubuntu/dists/jaunty/main/installer-i386/current/images/netboot/ubuntu-installer/i386/

You can edit the pxelinux.cfg file to edit the PXE boot menu

sudo nano /var/lib/tftpboot/pxelinux.cfg/default

Test out your config - It's useally hitting "F12" when your computer is booting and displaying the BIOS screen - Choose "Network Boot" - And watch the magic happen!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options