IIS and ASP PXE Booting and Vesamenu

 This is under construction and may not be complete 

Intro
PXE (Preboot Execution Environment) Booting, or just Network booting in general is very interesting, at least to me, and a few others. As I believe it was Marty Connor in this awesome video "gPXE: Modern FOSS Network Booting" said that some people get really excited over booting machines over networks (including the Internet!) while others... not so much.

Well, I'm one of those people who gets really excited over the idea of booting machines over a network, and I can't really put my finger on why, it's just awesome to me.

So, I wanted to document the netboot setups that I use at my home, and my work. This entry consists of my work setup. My home setup is detailed here

Now, network booting isn't for everyone, and it doesn't fit every situation, so your mileage will vary greatly.

My work setup consists of iPXE, ASP Scripting, Syslinux, and different separate utilities. All of this is detailed below... so lets begin!

What does this page assume?

 * You have a working network
 * You control your DHCP Server
 * You have control of your DNS server
 * You have a working webserver
 * Basic understanding of ASP
 * Have a basic understand of whats involved with PXE Booting, even if it's skimming over the Wikipedia page
 * Have a machine that is capable of picking the network card to boot from, via PXE (On most Dell systems, you need to go into the BIOS, Integrated Peripherals, and mark the NIC as "On W/ PXE", not just "On", or "On W/ ImageServer"

My Environment

 * Windows Server 2008 R2
 * IIS 7
 * Classic ASP Scripting
 * tftpd32 v4.00 (Service)
 * iPXE (current GIT master)
 * Syslinux 4.06_Pre11
 * Misc Utilities like Drive Fitness Test, SeaTools, Memtest, etc.

The Basic Process
-- My Setup
 * 1) Computer powers on, and selects the NIC to boot from, either via interaction, or it being the first device
 * 2) The native PXE Stack (iPXE (flashed onto the ROM/BIOS), Intel, Broadom, Realtek, etc) brings up the network card, does a DHCP Request, while also requesting, at least, options 66 and 67
 * 3) DHCP Server responds with an IP, and the two options
 * 4) The PXE Stack then tried to contact the server provided in option 66, to retrieve the file specified in option 67, which in this case is iPXE (for non-iPXE clients), over TFTP
 * 5) iPXE then unloads the native PXE stack (to a degree), and takes over, issuing it's own DHCP Request, again requesting, among other options, 66 and 67
 * 6) The DHCP Server responds with (typically) the same IP address, but now detects that the client is iPXE, and passes a different option 67.
 * 7) iPXE then boots to the URL passed in option 67 this time (via HTTP), and that script then directs it what to do.

IIS Config


TFTPD32 Config


Resources Used

 * http://ipxe.org -- iPXE's main site, which contains a ton of information (specifics are linked throughout the entry too)
 * http://forum.ipxe.org -- iPXE Forums, Great resource for finding answers, or asking questions.
 * http://lists.ipxe.org/pipermail/ipxe-devel/ -- iPXE Mailing List
 * http://etherboot.org -- Etherboot/gPXE, iPXE's predecessor. This is what I used when I first setup my netboot, and a lot of the setup came from here. Other issues aside, iPXE is a fork, and is being updated. Most of the information still applies to iPXE.
 * http://www.networksorcery.com/enp/protocol/bootp/options.htm -- General DHCP Options
 * http://www.vcritical.com/2011/07/vmware-esxi-5-interactive-pxe-installation-improvements/ -- Linked above, but want to again. This is a good article on how to get ESXi installer to run over PXE.
 * I'm sure there have been many over the years. As I come up with more, I will add them.
 * https://gist.github.com/2234639 -- Robin Smidsrød's iPXE menu
 * http://www.youtube.com/watch?v=GofOqhO6VVM -- Linked above, but linking again, as it's an Awesome presentation!
 * http://www.syslinux.org/wiki/index.php/Menu -- Syslinux's Menu documentation

Fin
These files may end up on my github at some point. If/when they do, I'll note it here.

iPXE is EXTREMELY powerful, especially with the embedded scripting. There is so much that can be done, it's hard to go into details, just because what you can do is so vast! A perfect example of this is Robin's iPXE menu linked to above. He does some awesome stuff!

I'm always looking to expand the netboot. Be adding diag utils, playing around with new options, or just plain tweaking it. In the above boot.php, a few of the things I want to tweak, is instead of referencing the name boot.example.com all the time, have it pull the PHP server variable. This way if you have a different hostname internal/external, as long as you set it once (say in a script, or via DHCP), it will always reference that server.

One thing to note with iPXE, is you can also embed the scripts into it. In my work netboot (coming soon!), I embed pxelinux.0 and a small script. This will be explained more in that post, but one thing to note, is you can embed a script that does DHCP, then chains to your server at home. As long as you have external access to that box, and flash the resulting iPXE to a USB drive, or CD, you can boot any machine anywhere in the world.

For contacting myself (for complaints/improvements/suggestions), or others who use iPXE, there is the IRC channel, irc.freenode.net, #ipxe. I'm pretty much always in there as Sedorox. The developers also hang out there, and other users too, who do all sorts of fun network booting things. Come visit!

Hopefully this helps someone better understand iPXE and netbooting, or at the very least, serves as an example on what you can do.