1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

PXE

From ltsp

Jump to: navigation, search

Contents

Using PXE to boot an LTSP workstation

Introduction to PXE

In the mid-90's, Compaq, Dell, HP, Intel, and Microsoft jointly released a system design guide for building Net PC systems. The guide describes a method of booting the operating system from a network server. This method eventually became known as the _Preboot Execution Environment_ (PXE). Several manufacturers have created implementations of the PXE specification, and include a PXE compliant BootROM on their network cards. Most computer motherboards with embedded network interfaces include PXE in the BIOS.

PXE is designed to load a small (32kb or less) image called a Network Bootstrap Program (NBP). The NBP is then responsible for loading the operating system image. When using PXE to boot an LTSP workstation, the choices for an NBP are PXELINUX and Etherboot.

/etc/dhcpd.conf

To use the PXE kernel, you will need to set the 'filename' entry in the /etc/dhcpd.conf file to point to the pxe bootloader.

Here is an example of what you need to add to dhcpd.conf:

host ws001 {
  hardware ethernet   00:E0:06:E8:00:84;
  fixed-address       192.168.0.1;
  filename            "/lts/2.4.26-ltsp-3/pxelinux.0";
}

The place of pxelinux.0 kernel and initrd

Normally, for Etherboot kernels, the kernel is placed in /tftpboot/lts. But, for PXE kernels, we create a subdirectory in that location that has a name that matches the version of the kernel. For example, in this release of the kernel, we create '/tftpboot/lts/2.4.26-ltsp-3'.

Within that directory, we place the kernel, the initrd image, the pxelinux.0 bootloader and a configuration subdirectory.


Booting with pxelinux.0

dhcp request

When the PXE bootrom starts up, it sends a dhcp request broadcast to the network.

dhcp answer

The dhcp server responds with several pieces of information, including the IP address of the workstation, the default gateway, the name of a file to download and the root-path.

downloading the bootloader with tftp

The PXE bootrom then uses the TFTP protocol to download the bootfile. The PXE bootrom has a limitation of only being able to load small (upto 32kb) files. It isn't able to load a full Linux kernel. So, instead, we set it up to load a small bootloader called 'pxelinux.0'. That bootloader is then able to load larger images, such as the Linux kernel and the initrd image.

pxelinux.0 and how to find a config file

pxelinux.0 starts executing, and it begins looking for a configuration file. It looks for a subdirectory called 'pxelinux.cfg', in the same directory where pxelinux.0 was found. It first looks for a filename based on the IP address of the workstation, converted to hex. If it doesn't find a file by that name, it chops the last hex digit from the filename. It keeps doing that, until there aren't any digits left. At that point, it looks for a file called 'pxelinux.cfg/default'. Therefore, if the IP address of the workstation is 192.168.0.1, then pxelinux.0 looks for a configuration file in the following order:

pxelinux.cfg/C0A80001
pxelinux.cfg/C0A8000
pxelinux.cfg/C0A800   
pxelinux.cfg/C0A80    
pxelinux.cfg/C0A8     
pxelinux.cfg/C0A
pxelinux.cfg/C0
pxelinux.cfg/C
pxelinux.cfg/default

Once the loader finds a file, it will output 'Loader aborted', and then go to syslinux's boot: prompt.

A perl helper: [/pxehelp.pl.txt pxehelp.pl.txt]:

echo "192.168.0.1" | ./pxehelp.pl
C0A80001
C0A8000
C0A800
C0A80
C0A8 
C0A
C0
C

The gethostip utility, which comes with pxelinux (in your ltsp root directory), does the same job:

/opt/ltsp/i386/usr/bin/gethostip 192.168.0.1
192.168.0.1 192.168.0.1 C0A80001

See also http://syslinux.zytor.com/pxe.php#config

The config file pxelinux.cfg

The format of the config file is very much like an /etc/lilo.conf file.

prompt 0 
default linux
timeout 5
label linux
kernel bzImage-2.4.26-ltsp-3
append init=/linuxrc rw root=/dev/ram0 initrd=initrd-2.4.26-ltsp-3.gz

The style of entries in pxelinux.cfg must conform to syslinux. See the faq for more options: http://syslinux.zytor.com/faq.php#config For instance, do not use the = sign for the parameters.

Passing Kernel parameters to the kernel

Options can be passed to the kernel via the 'append' line in the pxelinux.cfg file

You can supress a lot of the kernel's output by adding 'quiet' to the paramaters.

How kernel and initrd gets transferred

pxelinux.0 then uses TFTP to download the kernel image and the initrd image and jumps to the unpacking routine that comes within the kernel file. Your kernel gets extracted and finally started.

Generalization and Custom pxelinux config files

If you want to modify the parameters for a specific workstation, you can create a config file specifically for that workstation, by creating a config file with a name that matches all or part of the IP address of the workstation, converted to hex.

If you want to modify the parameters for ALL workstations, then you can simply add your modifications to the 'default' file.


The PXE Specs by Intel

http://www.intel.com/technology/computing/wfm.htm

More about syslinux which contains pxelinux

http://syslinux.zytor.com/ If you experience problems have a close look on http://syslinux.zytor.com/errors.php <snip> The single most common user error is setting up a kernel configuration which uses one of the reserved extensions: </snip>

---

PXEGRUB

PXEGRUB is a part of the GRUB package. It's kind of a mixture of PXE and GRUB. We've tried to use it to boot an LTSP client, but had problems. At this point, I'd recommend *against* using it to boot anything over the net. It took me several days to find out why machines tend to segfault programs. If you want to reproduce this, boot memtest86 or memtest86+ with pxegrub and see it failing over and over again, at the same addresses almost everytime.

pxegrub was trying to merge with etherboot's pxe stuff, so they took the etherboot's software Interrupt Controller, but it appears they did not clean it up.


Related Topics

Personal tools