Recent Posts


« | Main | »

Adventures in PXE-land via Cobbler

By Dale Reagan | September 16, 2008

Problem – I need a simple way to install/update/re-purpose/network boot/manage systems or servers on my network.  Is it possible to create a simple  infrastructure to provide this type of flexiblity?

There are numerous web pages describing remote booting (aka network booting, PXE booting.) Many of them provide all the basic information, however, if you deviate in any fashion (as with too many Open Source ‘solutions’) your results will vary and your frustration levels may climb.  Also, such pages, as useful as they may be, tend to not discuss any of the required ancilliary components.  For this post, I will attempt to cover the base concepts and components needed for implementing a remote booting service.

Overview of Remote booting (required components, high level)

Overview of the remote boot sequence (high level view)

Overview of tools and services used/configured for this test (high level view)

Ok, some real world experience.

Note – chances are good that your hardware is not the same as mine so your experiences should vary, however, understanding the required components/concepts will likely greatly reduce your time to resolutions of problems with this type of service;  this ties in nicely with Hypervisor service offerings which also have to deal with these types of configuration issues when managing a virtual host.

During my initial testing (following the suggestions from a helpful web page) I configured a server to provide DCHP/Bootp and TFTP.  I isolated the testing to a local sub-net so the only devices present were my server and a laptop with a PXE capable/enabled NIC.  I connected the server and laptop to an isolated router and powered up the laptop.   The laptop presented it’s normal startup screen messages and then went to PXE-land – and ‘hung’.  There was quite a bit of text presented but nothing useful, like perhaps some sort of help message/menu.  Hmm.  Was this information from the onboard PXE NIC? from the DHCP/Boot server? from some other component needed for this process?  Hmmm.  All the web pages I reviewed mentioned something like, “just pick an option from the menu.”  What menu???  Also, there was referenced to the ‘boot prompt’.  What boot prompt???  Hmm and hmm – time to dig.

Hmm, where to start?  I decide to take a look at the ‘network level’ so I fire up Wireshark and configure it to watch the NIC being used for this experiment.  I power-cycle the laptop and, as expected, see that after the PXE process starts I get network traffic requesting a DHCP IP assignment.  The laptop displays a message about DHCP and it’s network-acquired IP address.  Wireshark displays a number of packet entries with the final ones being ‘ARP‘ requests for a specific IP (i.e. ‘who has xxx.bbb.ccc.ddd?.)   The laptop ‘times out’ of the PXE process (i.e. the network boot fails) and begins a ‘normal startup’ from disk.  Hmmm.  I look through the configuration files on the server and find that the ARP IP is associated with a next-server entry.  After a bit of Internet searching I find that the next-server setting (in this context) really is the setting that defines the IP of your TFTP/boot server – so I change this entry (note I started by copying a sample configuration off the net but I missed making this fit with my network setup; after additional digging this is documented as a required setting when setting up this type of service.)

Ok, after adjusting the configuration on the boot server I power-cycle the laptop.  Good news! I now get a new set of information from PXELINUX – but it does not make much sense and I don’t see any sort of menu; I expect to see a menu provided by the Cobbler configuration…  Note that there is considerable documentation for PXELINUX – visit the link above – there’s not much mystery if you read the documentation…

I see something like the following:


Hmm.  Ok – it seems that:

  1. I made it past the BIOS PXE step (output not shown),
  2. connected to a DHCP server – I now have an IP shown by the BIOS PXE step,
  3. received Bootp data/file(s) (i.e. Pxelinux output similar to above sequence) and we are now waiting for either a timeout action (default boot setting) OR for user intervention.  You are ‘running’ the initial boot program…  This is a default/generic step.  If your server/PC has a dedicated entry in the dhcpd.conf file then you would/should be presented with a customized boot option (see custom boot below.)

Controlling the process from this point can be somewhat confusing since you could manage it manually or via other software – I am using Cobbler but I did visit:

The process will proceed based on the entries in dhcpd.conf file and the options included  in the ‘pxelinux.cfg/default’ file listed above (just ‘cat’ the file to see what is included.)  The dhcpd.conf entries for you ‘default’ file control whether or not your system will be allowed to boot from the server answering your boot request.  Note, if you do not see a ‘boot prompt’ then edit the ‘default’ file entry for ‘prompt’ and change it to/from ‘0’ or ‘1’ to toggle the ‘boot prompt’.

If you need additional information on this part of the process then I encourage you to visit the Syslinux/PXELinux site where quite a bit more information is presented.  Also, you may have the same information on your system – at a shell prompt try:   man syslinux OR man pxelinux.

########### borrowed from Syslinux Wiki ###########
### sample /etc/dhcpd.conf entries for network booting ###
allow booting;
allow bootp;

# Standard configuration directives…
option domain-name “domain_name”;
option subnet-mask subnet_mask;
option broadcast-address broadcast_address;
option domain-name-servers dns_servers;
option routers default_router;

# Group the PXE bootable hosts together
group {
# PXE-specific configuration directives…
next-server TFTP_server_address;
filename “/tftpboot/pxelinux.0“;

# You need an entry like this for every host
# unless you’re using dynamic addresses
host hostname {
hardware ethernet ethernet_address;
fixed-address hostname;
} ### group end
########### end of ‘borrowed’ example #############

Custom Boot – Machine Specific automatic network boot options

Ok.  We now proceed based on the specific configuration for out booting server/PC.   Within Cobbler I configure a system level setting that includes/specifies the MAC address for my network booting system.  The same steps as above are followed with the exception of the PXELINUX options – since I specified this system within Cobbler I will now get a customized, device specific set of boot options.  In this case I configured the options to include:

  1. enter ‘1’ for a network install – defaults to this option on timeout (what occurs will depend upon the values entered for this particular system within the Cobbler configuration; I could replace the OS install, upgrade it, or start Linux in rescue mode.)  Note that within Cobbler you specify a Kickstart file as well as optional kernel options that will control how automated this process will be.  Also note that you could put this system into an infinite network boot loop unless you configure Cobbler to prevent this.
  2. enter ‘2’ to boot from disk

My generic pxelinux.cfg/default file reverses the options above: 1) boot from disk, and 2..x) some other boot option.

With Cobbler configured and tested I now have a means to easily:

Next up – exploring Koan (Cobbler client tool for re-installs and managing virtual hosts.)

Topics: Computer Technology, Unix-Linux-Os, Web Problem Solving, Web Technologies | 2 Comments »

2 Responses to “Adventures in PXE-land via Cobbler”

  1. Larry Brigman Says:
    February 19th, 2010 at 11:03 pm

    You list gpxe as part of the tools but there is nothing about using it in the write-up. My research shows that gpxe isn’t supported
    except in something like a liveCD boot.

  2. Dale Reagan Says:
    February 22nd, 2010 at 10:47 am

    Hi Larry,

    GPXE was a diversion during my exploration of PXE booting with Cobbler system provisioning – if you have non-network boot gear (i.e. older NICS) then you can, as you indicate, use if for booting any system with bootable media (floppy, CD/DVD, USB or other media.) It is possible to use PXE–> GPXE –> whatever_boot_source_desired. I did not use GPXE for my production project(s) but it is worth exploring/understanding since it presents additional options beyond ‘normal’ automated boot/install options.


YOUR GeoIP Data | Ip:
Continent: NA | Country Code: US | Country Name: United States
Region: | State/Region Name: | City:
(US only) Area Code: 0 | Postal code/Zip:
Latitude: 38.000000 | Longitude: -97.000000
Note - if using a mobile device your physical location may NOT be accurate...

Georgia-USA.Com - Web Hosting for Business