PXE Booting: Part 1: What is/isn't PXE (netbooting)
You know that funky option in your computer's BIOS, "Network Boot Agent"? Okay, so it goes by a lot of names. "Networking Boot ROM," "Integrated NIC ROM," the list goes on. Maybe you've seen the "Press F12 to network boot option" around. You see this, your curiosity gets the best of you, so you hit F12. Suddenly your computer is scanning the ethernet subnet for a DHCP server and acquiring an IP address!
Only to go away really fast and continue booting up your computer without really telling you much. Awfully anti-climatic, if you ask me. I mean really, you add an option to your boot order, hit the button to make it go, and it starts doing all of these wonderful things only to promptly "stop" and advance in the boot order without telling you a thing.
Let's clear up the mysticism: what you (typically) just activated and attempted to use was this thing called PXE. PXE stands for "Preboot Execution Enviroment." Wikipedia has an awesome article (also available on the German Wikipedia) on the details of PXE, but I may be biased in thinking that because I assisted in it's writing. Admittedly, it has changed a fair amount over time, but the content of the article as a whole is still there. Now, come on, I know you're lazy and didn't read all of that artice. I'd even go as far as to say you didn't read any of it. So, if you're still wondering "What is this PXE thing?" I'll answer that here and now.
PXE is in it's most simple terms, a boot device. At least, that's what it appears to be to your BIOS. However, instead of spinning up your hard drive, it fires up the NIC in your computer and starts probing for DHCP (or BOOTP, but that won't be covered here. It's pretty much obselete). Then, once it has acquired an IP address with the needed DHCP options set, the PXE ROM goes about downloading and executing files off of a TFTP server.
So, what is PXE? A way to boot your computer without the need of a hard drive or any real physical storage medium. It's commonly known as netbooting. The process, as outlined above, is pretty simple. The NIC scans for a DHCP server, and then acquires an IP address. In it's brief exchange with the DHCP server, the client is sent several "DHCP Options" along with the IP address, one of which is commonly known as "filename." If the client does not find this option, it gives up and (typically) advances with the boot order. If it finds this option, however, it tries to download the specified file off of a TFTP server. An additional option which can be given is "next-server" which is the IP address of the TFTP server to contact in order to download "filename." If the "next-server" paramater is omitted, then it defaults to the same IP as the DHCP server, and likewise tries to download "filename" and in turn, execute the file it downloads.
That's it. That right there is the majority of what PXE "is" and how it works. Why did your computer acquire an IP address only to just continue on booting? Because you didn't have the needed DHCP options set. To be fair, the huge majority (99%) of all home routers lack the ability to configure the needed options, so it's likely you've never even heard of "DHCP Options." However, my personal feelings on how retarded home routers are do not belong here.
Let's move on to a "What is/isn't PXE" list real quick.
PXE is:
- A way of booting your computer without a hard drive or CD-ROM (or floppy, for you old people)
- Very useful - does not require physical storage in the computer to work
- Light - DHCP options and a TFTP server are the only requirements
- Powerful - ever wonder what it'd be like to walk into a room of computers, turn them all on, press F12, and come back an hour later to fresh installs of (your OS here)? I've done it with Windows, and I must say, it's management/installation/reinstallation bliss.
PXE isn't:
- A way to "network boot this ISO image I have here" (but it is possible given time)
- ... even related to the boot loader or actual software side of the computer. It downloads a file, it runs a file, that's IT. It's not a kernel, it lacks any real form of hardware support. It exists to run something else, not run your system for you.
- Diskless booting. Sure, it CAN do that, but again, PXE isn't there to run your system for you.
- Thin clients. Refer to above statement. And statement above said above statement. You get the idea.
- Overly detailed. When I started messing with PXE, it made little sense as a whole and felt very hacked together once I got it working. This was largely due to a lack of documentation.
In sum, PXE has a vast number of capabilities, but PXE in and of itself is pretty much worthless. You can't feed it an ISO of a bootable CD and say "Go!," nor can you magically make an entire lab of computers run Firefox without hardrives. I'll admit it in full: PXE does not run your computer for you. You are in charge of that. But, it certaintly can help in installing OSs or running entire diskless labs. If this seems unclear, I'm sure the latter articles will clear it up.
In the next few parts, I'll use the following software: ISC DHCP,
tftp-hpa, pxelinux, memtest86+, and maybe a little bit of the debian
installer. Who knows, maybe I'll splurge and go overboard with some
CentOS installation over PXE, but for the most part, you're safe with
the previous list. (Don't go downloading all of the debian CDs though,
as we won't be using them.)
It should also be noted that I have written and maintain the only wiki
(that I know of anyways) that is dedicated to the topic of PXE booting.
For the curious, that wiki is available here.

Hi Kyle
Looks like you might know the answer to something I just can't seem to find.
If I have a running Linux system, how can I query the UUID the NIC(s) will use during PXE boot?
The idea is I'll be reloading some servers via PXE, and they're currently running, and I'd like to pre-populate all the pxelinux.cfg and customized kickstart files before/without having to grab the UUID from TFTP logs.
Obviously, I can get MAC from ifconfig, and there's lots of fun stuff under /proc, but I can't find UUID to save my life.
Thanks in advance!
Peter