PXE Boot Install for Ubuntu

Install services

You need the following packages:

tftpd-hpa
dhcp3-server

Prepare your tftp server

Start your tftpd server via inetd with the following line in /etc/inetd.conf:

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

Don’t forget to create the tftp directory /var/lib/tftpboot (if it hasn’t already been created)

mkdir /var/lib/tftpboot

On Ubuntu 6.06 Server (or if /etc/inetd.conf doesn’t exist) you might edit /etc/default/tftpd-hpa:

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

Prepare your dhcp-server

If you have a working dhcp server add the following lines to your group, substituting ip and mac address as needed

host pxeinstall {
hardware ethernet [mac-address of pxe networkcard without brackets];
fixed-address 10.0.0.16;
next-server [ip-address of the server serving tftp];
filename "pxelinux.0";
}

The following simpler file may also work in a trivial environment

subnet 0.0.0.0 netmask 0.0.0.0 {
range 192.168.0.1 192.168.0.2;
filename "pxelinux.0";
}

Note that you need to assign the client an IP address in the same subnet as the address of the server running tftpd. For example, if your server’s address is 192.168.2.13, you should assign your client an IP address that begins with 192.168.2, NOT 192.168.0 .

The next-server stanza tells the pxe boot client where to look for the boot image and associated data. It is required in newer editions of tftpd-hpa.

Prepare ubuntu netboot

Get the files

All the files you need are on the install media, or you can get them here.

Put the netboot files into the /tftpboot directory.

lftp -c "open http://archive.ubuntu.com/ubuntu/dists/dapper/main/installer-i386/current/images/; mirror netboot/"
cp -a netboot/* /var/lib/tftpboot
# untar the pxeboot.tar.gz
cd /var/lib/tftpboot/
tar xfz pxeboot.tar.gz

pxe bootloader config

Edit or patch pxelinux.cfg/default .

--- default.org 2004-10-31 15:32:32.000000000 +0100
+++ default 2004-10-31 00:14:52.000000000 +0200
@@ -13,17 +13,11 @@
F0 debian-installer/boot-screens/f10.txt

label linux
- kernel debian-installer/linux
- append vga=normal initrd=debian-installer/initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --
+ kernel vmlinuz
+ append vga=normal initrd=initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --
label expert
- kernel debian-installer/linux
- append DEBCONF_PRIORITY=low vga=normal initrd=debian-installer/initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --
-label custom
- kernel debian-installer/linux
- append ubuntu/install-type=custom vga=normal initrd=debian-installer/initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --
-label custom-expert
- kernel debian-installer/linux
- append ubuntu/install-type=custom DEBCONF_PRIORITY=low vga=normal initrd=debian-installer/initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --
+ kernel vmlinuz
+ append DEBCONF_PRIORITY=low vga=normal initrd=initrd.gz ramdisk_size=11057 root=/dev/rd/0 devfs=mount,dall rw --

prompt 1
timeout 0

Make a symlink from default to the ip of the pxe boot client.

cd /tftpboot/pxelinux.cfg
ln -s default 0A000010

Directory layout

Should look like this:

/tftpboot/
/tftpboot/pxelinux.0
/tftpboot/initrd.gz
/tftpboot/mini.iso
/tftpboot/debian-installer
/tftpboot/debian-installer/linux
/tftpboot/debian-installer/initrd.gz
/tftpboot/debian-installer/boot-screens
/tftpboot/debian-installer/boot-screens/splash.rle
/tftpboot/debian-installer/boot-screens/f1.txt
/tftpboot/debian-installer/boot-screens/f2.txt
/tftpboot/debian-installer/boot-screens/f3.txt
/tftpboot/debian-installer/boot-screens/f4.txt
/tftpboot/debian-installer/boot-screens/f5.txt
/tftpboot/debian-installer/boot-screens/f6.txt
/tftpboot/debian-installer/boot-screens/f7.txt
/tftpboot/debian-installer/boot-screens/f8.txt
/tftpboot/debian-installer/boot-screens/f9.txt
/tftpboot/debian-installer/boot-screens/syslinux.txt
/tftpboot/debian-installer/boot-screens/f10.txt
/tftpboot/initrd.list
/tftpboot/vmlinuz
/tftpboot/pxelinux.cfg
/tftpboot/pxelinux.cfg/default
/tftpboot/pxelinux.cfg/0A000010

Start the PXE client

Just boot up the computer that will use DHCP and then PXE to get the images, if something isn’t working you can use a sniffer on your install server to check.

tethereal -R bootp
#tethereal -VR bootp
tethereal port tftp
tcpdump -n

One thought on “PXE Boot Install for Ubuntu

  1. Pingback: Computers hate me. at Kyle Schneider

Leave a Reply

Your email address will not be published. Required fields are marked *