Thursday, February 12, 2009

Configuring Windows 2003 DHCP for PXE Clients

Today, I was lending a hand to one of our Linux admins who was trying to get his servers Kickstarted. For the unitiated, Kickstart is the Linux equivalent to Windows RIS.

PXE stands for Pre-boot eXecution Environment. PXE clients (commonly known as "diskless workstations") rely on DHCP to tell them where to go for their boot configuration and software. Windows 2003 can handle these requests, with a little bit of work.

Supporting PXE clients requires the following options:

003 Router (potentially, if resources you need are on a different subnet)
013 Boot File Size
043 Vendor Specific Info
060 ClassID
066 Boot Server Host Name
067 Bootfile Name

So, off you go to configure it. But wait, Windows 2003 DHCP doesn't have option 060! What now?

Relax. Fortunately, there's a way to configure the DHCP service to have this option.

On your DHCP server, open up a command prompt and launch netsh.

As you can see, the commands are:

netsh dhcp>server \\test
netsh dhcp server>add optiondef 60 ClassID String 0
netsh dhcp server>set optionvalue 60 STRING PXEClient

You can actually add any of the RFC options for DHCP through this context. Microsoft ships the basic ones, but with netsh, you can customize the DHCP service.

Then, restart the DHCP service. If you have the service and management console running while you do this, you'll see "Unknown Option" when you look under server options.

Launch the DHCP Admin Conosole, and navigate to your scope (or server) options, depending on where you want to set your PXE boot options.

Right-click "Scope Options" (or "Server Options," as appropriate) and select Configure Options.

Select option 013 Boot File Size, and enter the boot file size in 512 octet blocks. For example, if your boot file is 32KB, convert it to bytes (1024*32, which is 32768), and then divide that number by 512 (32768/512). Put the result (64) in the data field.

Select option 043 Vendor Specific Info and enter the following binay value:
01 04 00 00 00 00 ff

Select option 066 Boot Server Host Name and enter the IP address of the TFTP server hosting your boot image in the data field.

Select option 067 Bootfile Name and enter the name of the boot image that you wish to use.

Ensure your devices have PXE-enabled NICs (if you're using newer servers, nearly all of them do) and boot. If you need help on setting up a TFTP Server on Windows 2003, look no further.


  1. Great article, but one typo. Under the section about setting the size of the 512 octet blocks, you say that you divide by 12. This should be divided by 512. Your final number is right, but the math looks wrong.

  2. Sincere thanks for this great article. You saved me from having to use ip helper statements to enable my PXE services on the network. Microsoft says their DHCP server won't refer clients to separate PXE servers (, but once again, they're wrong. I implemented your solution and it works great with Thinstation (using TFTP3d) or OpenThinClient OS. I never would have been able to figure this out on my own...Thanks so much!

  3. "and then divide that number by 12 (32768/512)"
    Shouldn't it be "devide that number by 512"? :)

    And thanks a lot for this article, helped me a lot.

  4. Robert,

    Yes, a typo on my part. It has been corrected.