Difference between revisions of "PXELINUX"

From Syslinux Wiki
Jump to: navigation, search
(Revert from plain decimal to "hh:hh" notation.)
m (Use "V" template. Wiki formatting. Typos.)
 
Line 60: Line 60:
 
you want to boot.
 
you want to boot.
  
<tt>[5.00+]</tt> Also copy  
+
{{V|5.00+}} Also copy  
 
{{nowrap|"<tt>ldlinux.c32</tt>"}}  
 
{{nowrap|"<tt>ldlinux.c32</tt>"}}  
 
from the Syslinux distribution to the  
 
from the Syslinux distribution to the  
Line 77: Line 77:
 
* the client UUID is {{nowrap|"<tt>b8945908-d6a6-41a9-611d-74a6ab80b83d</tt>"}}; and,  
 
* the client UUID is {{nowrap|"<tt>b8945908-d6a6-41a9-611d-74a6ab80b83d</tt>"}}; and,  
 
* the <tt>Ethernet</tt> MAC address is {{nowrap|"<tt>88:99:AA:BB:CC:DD</tt>"}}; and,  
 
* the <tt>Ethernet</tt> MAC address is {{nowrap|"<tt>88:99:AA:BB:CC:DD</tt>"}}; and,  
* the IP address is {{nowrap|"<tt>192.168.2.91</tt>"}}, <!--
+
* the IP address is {{nowrap|"<tt>192.168.2.91</tt>"}}, <!--  
 
--> or in uppercase hexadecimal, {{nowrap|"<tt>C0A8025B</tt>"}};  
 
--> or in uppercase hexadecimal, {{nowrap|"<tt>C0A8025B</tt>"}};  
  
 
then PXELINUX will try the following configuration files (in this order):  
 
then PXELINUX will try the following configuration files (in this order):  
  
 
+
{|
<pre>
+
|
/mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
+
  /mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
/mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
+
  /mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
/mybootdir/pxelinux.cfg/C0A8025B
+
  /mybootdir/pxelinux.cfg/C0A8025B
/mybootdir/pxelinux.cfg/C0A8025
+
  /mybootdir/pxelinux.cfg/C0A8025
/mybootdir/pxelinux.cfg/C0A802
+
  /mybootdir/pxelinux.cfg/C0A802
/mybootdir/pxelinux.cfg/C0A80
+
  /mybootdir/pxelinux.cfg/C0A80
/mybootdir/pxelinux.cfg/C0A8
+
  /mybootdir/pxelinux.cfg/C0A8
/mybootdir/pxelinux.cfg/C0A
+
  /mybootdir/pxelinux.cfg/C0A
/mybootdir/pxelinux.cfg/C0
+
  /mybootdir/pxelinux.cfg/C0
/mybootdir/pxelinux.cfg/C
+
  /mybootdir/pxelinux.cfg/C
/mybootdir/pxelinux.cfg/default
+
  /mybootdir/pxelinux.cfg/default
</pre>
+
|}
  
 
Let's see now what exactly the above example represents.
 
Let's see now what exactly the above example represents.
Line 106: Line 106:
  
 
* The client UUID, if provided by the PXE stack.  
 
* The client UUID, if provided by the PXE stack.  
: Note that some BIOSes do not have a valid UUID, <!--
+
: Note that some BIOSes do not have a valid UUID, <!--  
 
--> and it might end up reporting something like all 1's.  
 
--> and it might end up reporting something like all 1's.  
: This value is represented in the standard UUID format <!--
+
: This value is represented in the standard UUID format <!--  
--> using lowercase hexadecimal digits, <!--
+
--> using lowercase hexadecimal digits, <!--  
 
--> {{nowrap|e.g. "<tt>b8945908-d6a6-41a9-611d-74a6ab80b83d</tt>"}}.
 
--> {{nowrap|e.g. "<tt>b8945908-d6a6-41a9-611d-74a6ab80b83d</tt>"}}.
  
* The hardware type (using its ARP type code) and address, <!--
+
* The hardware type (using its ARP type code) and address, <!--  
 
--> all in lowercase hexadecimal with dash separators.
 
--> all in lowercase hexadecimal with dash separators.
: For example, for an Ethernet (ARP type "<tt>1</tt>") with address <!--
+
: For example, for an Ethernet (ARP type "<tt>1</tt>") with address <!--  
--> {{nowrap|"<tt>88:99:AA:BB:CC:DD</tt>"}}, <!--
+
--> {{nowrap|"<tt>88:99:AA:BB:CC:DD</tt>"}}, <!--  
--> it would search for the filename <!--
+
--> it would search for the filename <!--  
 
--> {{nowrap|"<tt>01-88-99-aa-bb-cc-dd</tt>"}}.
 
--> {{nowrap|"<tt>01-88-99-aa-bb-cc-dd</tt>"}}.
  
* The client's own IPv4 address in uppercase hexadecimal, <!--
+
* The client's own IPv4 address in uppercase hexadecimal, <!--  
--> followed by removing hex characters, one at a time, from the end. <!--
+
--> followed by removing hex characters, one at a time, from the end. <!--  
--> For example, <!--
+
--> For example, <!--  
 
--> {{nowrap|"<tt>192.168.2.91</tt>" &rarr; "<tt>C0A8025B</tt>"}}.  
 
--> {{nowrap|"<tt>192.168.2.91</tt>" &rarr; "<tt>C0A8025B</tt>"}}.  
: The included program, {{nowrap|"<tt>gethostip</tt>"}}, <!--
+
: The included program, {{nowrap|"<tt>gethostip</tt>"}}, <!--  
 
--> can be used to compute the hexadecimal IP address for any host.
 
--> can be used to compute the hexadecimal IP address for any host.
  
Line 135: Line 135:
 
to be 127 characters or shorter in length.
 
to be 127 characters or shorter in length.
  
<tt>[3.20+]</tt> If PXELINUX cannot find a configuration file,  
+
{{V|3.20+}} If PXELINUX cannot find a configuration file,  
 
it will reboot after the timeout interval has expired.  
 
it will reboot after the timeout interval has expired.  
 
This keeps a machine from getting stuck indefinitely due to a boot server failure.
 
This keeps a machine from getting stuck indefinitely due to a boot server failure.
Line 147: Line 147:
 
<span id="Can_I_send_information_to_PXELINUX_via_special_options_in_the_DHCP response.3F"></span>
 
<span id="Can_I_send_information_to_PXELINUX_via_special_options_in_the_DHCP response.3F"></span>
  
<tt>[1.62+]</tt> Depending on the specific DHCP server,  
+
{{V|1.62+}} Depending on the specific DHCP server,  
 
the following nonstandard DHCP options might be available  
 
the following nonstandard DHCP options might be available  
so to customize the specific behaviour of PXELINUX.  
+
so as to customize the specific behaviour of PXELINUX.  
 
See RFC 5071 for some additional information about these options.  
 
See RFC 5071 for some additional information about these options.  
 
Options for PXELINUX can be specified by DHCP options,  
 
Options for PXELINUX can be specified by DHCP options,  
Line 157: Line 157:
 
=== Option priority ===
 
=== Option priority ===
  
Hardcoded "after-options" are applied after DHCP options (and overrride them)  
+
Hardcoded "after-options" are applied after DHCP options (and override them)  
 
while hardcoded "before-options" are applied prior to DHCP options.  
 
while hardcoded "before-options" are applied prior to DHCP options.  
 
The default behavior takes the lowest priority.
 
The default behavior takes the lowest priority.
Line 165: Line 165:
  
 
; Option 208 ''pxelinux.magic''
 
; Option 208 ''pxelinux.magic''
: Earlier versions of PXELINUX required this option to be set to <!--
+
: Earlier versions of PXELINUX required this option to be set to <!--  
--> {{nowrap|1=<tt><nowiki>F1:00:74:7E</nowiki></tt>}} <!--
+
--> {{nowrap|1=<tt><nowiki>F1:00:74:7E</nowiki></tt>}} <!--  
--> {{nowrap|1=<nowiki>(241.0.116.126)</nowiki>}} <!--
+
--> {{nowrap|1=<nowiki>(241.0.116.126)</nowiki>}} <!--  
--> for PXELINUX to be able to recognize <!--
+
--> for PXELINUX to be able to recognize <!--  
--> any special DHCP options whatsoever. <!--
+
--> any special DHCP options whatsoever. <!--  
 
--> As of PXELINUX 3.55, this option is deprecated and is no longer required.
 
--> As of PXELINUX 3.55, this option is deprecated and is no longer required.
  
 
; Option 209 ''pxelinux.configfile''
 
; Option 209 ''pxelinux.configfile''
: Specify the initial PXELINUX configuration file name, <!--
+
: Specify the initial PXELINUX configuration file name, <!--  
 
--> which may be qualified or unqualified.
 
--> which may be qualified or unqualified.
  
 
; Option 210 ''pxelinux.pathprefix''
 
; Option 210 ''pxelinux.pathprefix''
: Specify the PXELINUX common path prefix, <!--
+
: Specify the PXELINUX common path prefix, <!--  
--> instead of deriving it from the boot file name. <!--
+
--> instead of deriving it from the boot file name. <!--  
--> This almost certainly needs to end in whatever character <!--
+
--> This almost certainly needs to end in whatever character <!--  
--> the TFTP server OS uses as a {{nowrap|pathname separator}}, <!--
+
--> the TFTP server OS uses as a {{nowrap|pathname separator}}, <!--  
 
--> e.g. slash (/) for Unix.
 
--> e.g. slash (/) for Unix.
  
 
; Option 211 ''pxelinux.reboottime''
 
; Option 211 ''pxelinux.reboottime''
: Specify, in seconds, the time to wait before reboot in the event <!--
+
: Specify, in seconds, the time to wait before reboot in the event <!--  
--> of TFTP failure. <!--
+
--> of TFTP failure. <!--  
--> {{nowrap|"<tt>0</tt>" (zero)}} means wait "forever" <!--
+
--> {{nowrap|"<tt>0</tt>" (zero)}} means wait "forever" <!--  
 
--> (in reality, it waits approximately 136 years).
 
--> (in reality, it waits approximately 136 years).
 
<br />
 
<br />
Line 192: Line 192:
 
=== Hardcoded options ===
 
=== Hardcoded options ===
  
<tt>[3.83+]</tt> The program {{nowrap|"<tt>pxelinux-options</tt>"}}  
+
{{V|3.83+}} The program {{nowrap|"<tt>pxelinux-options</tt>"}}  
 
can be used to {{nowrap|hard-code}} DHCP options into the  
 
can be used to {{nowrap|hard-code}} DHCP options into the  
 
{{nowrap|"<tt>pxelinux.0</tt>"}} image file.  
 
{{nowrap|"<tt>pxelinux.0</tt>"}} image file.  
Line 200: Line 200:
 
Hardcoded options:  
 
Hardcoded options:  
 
<pre>
 
<pre>
    6 => 'domain-name-servers',
+
  6 => 'domain-name-servers',
  15 => 'domain-name',
+
  15 => 'domain-name',
  54 => 'next-server',
+
  54 => 'next-server',
  209 => 'config-file',
+
209 => 'config-file',
  210 => 'path-prefix',
+
210 => 'path-prefix',
  211 => 'reboottime'
+
211 => 'reboottime'
 
</pre>
 
</pre>
  
Line 235: Line 235:
  
 
Example:  
 
Example:  
 +
{|
 +
|
 
<pre>
 
<pre>
  LABEL linux-http
+
LABEL linux-http
  LINUX http://boot-server/boot/mykernel
+
LINUX http://boot-server/boot/mykernel
  APPEND initrd=http://boot-server/boot/myinitrd
+
APPEND initrd=http://boot-server/boot/myinitrd
 
</pre>
 
</pre>
 +
|}
  
 
== Filename syntax ==
 
== Filename syntax ==
Line 246: Line 249:
  
 
; <nowiki>::filename</nowiki>
 
; <nowiki>::filename</nowiki>
: Suppress the common filename prefix, <!--
+
: Suppress the common filename prefix, <!--  
 
--> i.e. passes the string "filename" unmodified to the server.
 
--> i.e. passes the string "filename" unmodified to the server.
  
 
; <nowiki>IP address::filename</nowiki>
 
; <nowiki>IP address::filename</nowiki>
 
: (e.g. 192.168.2.3::filename)  
 
: (e.g. 192.168.2.3::filename)  
: Suppress the common filename prefix, <!--
+
: Suppress the common filename prefix, <!--  
 
--> <u>and</u> send a request to an alternate TFTP server.  
 
--> <u>and</u> send a request to an alternate TFTP server.  
 
: Instead of an IP address, a DNS name can be used.  
 
: Instead of an IP address, a DNS name can be used.  
: It will be assumed to be fully qualified if it contains dots; <!--
+
: It will be assumed to be fully qualified if it contains dots; <!--  
--> otherwise the local domain as reported by <!--
+
--> otherwise the local domain as reported by <!--  
 
--> the DHCP server {{nowrap|(option 15)}} will be added.
 
--> the DHCP server {{nowrap|(option 15)}} will be added.
  
Line 264: Line 267:
 
please [[contact]] the Syslinux mailing list.
 
please [[contact]] the Syslinux mailing list.
  
<tt>[4.00+]</tt>, PXELINUX also supports standard URL syntax.
+
{{V|4.00+}} PXELINUX also supports standard URL syntax.
  
 
== Keeppxe ==
 
== Keeppxe ==
Line 292: Line 295:
 
the following files will be attempted in this order  
 
the following files will be attempted in this order  
 
(after {{nowrap|"config-file"}} options):  
 
(after {{nowrap|"config-file"}} options):  
 
+
{|
mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
+
|
mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
+
  mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
mybootdir/pxelinux.cfg/C0A8025B
+
  mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
mybootdir/pxelinux.cfg/C0A8025
+
  mybootdir/pxelinux.cfg/C0A8025B
mybootdir/pxelinux.cfg/C0A802
+
  mybootdir/pxelinux.cfg/C0A8025
mybootdir/pxelinux.cfg/C0A80
+
  mybootdir/pxelinux.cfg/C0A802
mybootdir/pxelinux.cfg/C0A8
+
  mybootdir/pxelinux.cfg/C0A80
mybootdir/pxelinux.cfg/C0A
+
  mybootdir/pxelinux.cfg/C0A8
mybootdir/pxelinux.cfg/C0
+
  mybootdir/pxelinux.cfg/C0A
mybootdir/pxelinux.cfg/C
+
  mybootdir/pxelinux.cfg/C0
mybootdir/pxelinux.cfg/default
+
  mybootdir/pxelinux.cfg/C
 +
  mybootdir/pxelinux.cfg/default
 +
|}
  
 
=== TFTP servers ===
 
=== TFTP servers ===
Line 321: Line 326:
 
Some TFTP servers that have been successfully used with PXELINUX include:
 
Some TFTP servers that have been successfully used with PXELINUX include:
  
* The "tftp-hpa" TFTP server <!--
+
* The "tftp-hpa" TFTP server <!--  
--> (highly portable and port of the BSD TFTP server code) <!--
+
--> (highly portable and port of the BSD TFTP server code) <!--  
 
--> supports options and is available at:  
 
--> supports options and is available at:  
 
<blockquote>
 
<blockquote>
Line 334: Line 339:
 
   ftp://ftp.mamalinux.com/pub/atftp/   
 
   ftp://ftp.mamalinux.com/pub/atftp/   
 
</blockquote>
 
</blockquote>
: atftp is likely going to perform better than {{nowrap|"tftp-hpa"}} <!--
+
: atftp is likely going to perform better than {{nowrap|"tftp-hpa"}} <!--  
 
--> on a large boot server, but may not be quite as widely portable.
 
--> on a large boot server, but may not be quite as widely portable.
  
* If your boot server is running Windows (and you can't change that), <!--
+
* If your boot server is running Windows (and you can't change that), <!--  
--> try "tftpd32" by Philippe Jounin (you need version 2.11 or later; <!--
+
--> try "tftpd32" by Philippe Jounin (you need version 2.11 or later; <!--  
 
--> previous versions had a bug which made it incompatible with PXELINUX):  
 
--> previous versions had a bug which made it incompatible with PXELINUX):  
 
<blockquote>
 
<blockquote>
Line 344: Line 349:
 
</blockquote>
 
</blockquote>
  
* Eric Cook of Intel also reports that the TFTPD server from <!--
+
* Eric Cook of Intel also reports that the TFTPD server from <!--  
 
--> Win2000 Server RIS can be used:  
 
--> Win2000 Server RIS can be used:  
 
<blockquote>
 
<blockquote>
Line 357: Line 362:
 
you end up with the MS PXE stuff, which is ugly to get rid of.  
 
you end up with the MS PXE stuff, which is ugly to get rid of.  
 
</blockquote>
 
</blockquote>
: However, Christian "Dr. Disk" Hechelmann reports having success <!--
+
: However, Christian "Dr. Disk" Hechelmann reports having success <!--  
--> with using the Windows RIS as-is, and has sent a nice writeup <!--
+
--> with using the Windows RIS as-is, and has sent a nice writeup <!--  
 
--> on how to set it up. See [[RIS|Windows Remote Install System]].
 
--> on how to set it up. See [[RIS|Windows Remote Install System]].
  
Line 382: Line 387:
 
would look something like the following, using ISC dhcp (2.0 or later)  
 
would look something like the following, using ISC dhcp (2.0 or later)  
 
{{nowrap|"dhcpd.conf"}} syntax:  
 
{{nowrap|"dhcpd.conf"}} syntax:  
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
allow booting;
+
{|
allow bootp;
+
|
+
<pre>
# Standard configuration directives...
+
allow booting;
+
allow bootp;
option domain-name "domain_name";
+
option subnet-mask subnet_mask;
+
# Standard configuration directives...
option broadcast-address broadcast_address;
+
option domain-name-servers dns_servers;
+
option domain-name "domain_name";
option routers default_router;
+
option subnet-mask subnet_mask;
+
option broadcast-address broadcast_address;
# Group the PXE bootable hosts together
+
option domain-name-servers dns_servers;
group {
+
option routers default_router;
# PXE-specific configuration directives...
+
next-server TFTP_server_address;
+
# Group the PXE bootable hosts together
filename "/tftpboot/pxelinux.0";
+
group {
+
  # PXE-specific configuration directives...
# You need an entry like this for every host
+
  next-server TFTP_server_address;
# unless you're using dynamic addresses
+
  filename "/tftpboot/pxelinux.0";
host hostname {
+
 
hardware ethernet ethernet_address;
+
  # You need an entry like this for every host
fixed-address hostname;
+
  # unless you're using dynamic addresses
}
+
  host hostname {
}
+
  hardware ethernet ethernet_address;
 +
  fixed-address hostname;
 +
  }
 +
}
 +
</pre>
 +
|}
  
 
Note that if your particular TFTP daemon runs under chroot  
 
Note that if your particular TFTP daemon runs under chroot  
Line 432: Line 438:
 
{{nowrap|"<code>option vendor-class-identifier</code>"}}  
 
{{nowrap|"<code>option vendor-class-identifier</code>"}}  
 
{{nowrap|(ISC dhcp 3): }}
 
{{nowrap|(ISC dhcp 3): }}
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
allow booting;
+
{|
allow bootp;
+
|
+
<pre>
# Standard configuration directives...
+
allow booting;
+
allow bootp;
option domain-name "domain_name";
+
option subnet-mask subnet_mask;
+
# Standard configuration directives...
option broadcast-address broadcast_address;
+
option domain-name-servers dns_servers;
+
option domain-name "domain_name";
option routers default_router;
+
option subnet-mask subnet_mask;
+
option broadcast-address broadcast_address;
# Group the PXE bootable hosts together
+
option domain-name-servers dns_servers;
group {
+
option routers default_router;
# PXE-specific configuration directives...
+
option dhcp-class-identifier "PXEClient";
+
# Group the PXE bootable hosts together
next-server pxe_boot_server_address;
+
group {
+
  # PXE-specific configuration directives...
# You need an entry like this for every host
+
  option dhcp-class-identifier "PXEClient";
# unless you're using dynamic addresses
+
  next-server pxe_boot_server_address;
host hostname {
+
 
hardware ethernet ethernet_address;
+
  # You need an entry like this for every host
fixed-address hostname;
+
  # unless you're using dynamic addresses
}
+
  host hostname {
}
+
  hardware ethernet ethernet_address;
 +
  fixed-address hostname;
 +
  }
 +
}
 +
</pre>
 +
|}
  
 
Here, the boot file name is obtained from the PXE server.  
 
Here, the boot file name is obtained from the PXE server.  
Line 472: Line 479:
 
It has been known to boot some configurations correctly; however,  
 
It has been known to boot some configurations correctly; however,  
 
there are no guarantees:  
 
there are no guarantees:  
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
  allow booting;
+
{|
  allow bootp;
+
|
 +
<pre>
 +
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...
 +
  option dhcp-class-identifier "PXEClient";
 +
  option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62:6f:6f:74:0a:07:00:50:72:6f:6d:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00:00:ff;
 +
  next-server TFTP_server;
 +
  filename "/tftpboot/pxelinux.0";
 
    
 
    
   # Standard configuration directives...
+
   # You need an entry like this for every host
 
+
  # unless you're using dynamic addresses
  option domain-name "domain_name";
+
  host hostname {
  option subnet-mask subnet_mask;
+
  hardware ethernet ethernet_address;
  option broadcast-address broadcast_address;
+
  fixed-address hostname;
  option domain-name-servers dns_servers;
+
  option routers default_router;
+
 
+
  # Group the PXE bootable hosts together
+
  group {
+
    # PXE-specific configuration directives...
+
    option dhcp-class-identifier "PXEClient";
+
    option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62:6f:6f:74:0a:07:00:50:72:6f:6d:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00:00:ff;
+
    next-server TFTP_server;
+
    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;
+
    }
+
 
   }
 
   }
 +
}
 +
</pre>
 +
|}
  
 
Note that this will <u>not</u> boot some clients that <u>will</u> boot  
 
Note that this will <u>not</u> boot some clients that <u>will</u> boot  
Line 519: Line 527:
 
<!-- as "pre" does not parse wiki markup. -->
 
<!-- as "pre" does not parse wiki markup. -->
  
option space pxelinux;
+
{|
option pxelinux.magic      code 208 = string;
+
|
option pxelinux.configfile code 209 = text;
+
  option space pxelinux;
option pxelinux.pathprefix code 210 = text;
+
  option pxelinux.magic      code 208 = string;
option pxelinux.reboottime code 211 = unsigned integer 32;
+
  option pxelinux.configfile code 209 = text;
 +
  option pxelinux.pathprefix code 210 = text;
 +
  option pxelinux.reboottime code 211 = unsigned integer 32;
 +
|}
  
 
<font size="1" color="gray">Note: In earlier versions of PXELINUX,  
 
<font size="1" color="gray">Note: In earlier versions of PXELINUX,  
Line 529: Line 540:
 
Since PXELINUX 2.07, this will work both as a  
 
Since PXELINUX 2.07, this will work both as a  
 
{{nowrap|"<tt>site-option-space</tt>"}} (unencapsulated) and as a  
 
{{nowrap|"<tt>site-option-space</tt>"}} (unencapsulated) and as a  
{{nowrap|"<tt>vendor-option-space</tt>"}} (type 43 encapsulated.)  
+
{{nowrap|"<tt>vendor-option-space</tt>"}} (type 43 encapsulated).
 
This may avoid messing with the  
 
This may avoid messing with the  
 
{{nowrap|"<tt>dhcp-parameter-request-list</tt>"}}, as detailed below.</font>
 
{{nowrap|"<tt>dhcp-parameter-request-list</tt>"}}, as detailed below.</font>
  
<tt>[PXELINUX 2.07+]</tt> This is supported both as a  
+
{{V|PXELINUX 2.07+}} This is supported both as a  
 
{{nowrap|"<tt>site-option-space</tt>"}},  
 
{{nowrap|"<tt>site-option-space</tt>"}},  
 
and as a {{nowrap|"<tt>vendor-option-space</tt>"}}.
 
and as a {{nowrap|"<tt>vendor-option-space</tt>"}}.
Line 540: Line 551:
 
PXELINUX-related options, such as the "filename" option), you would add,  
 
PXELINUX-related options, such as the "filename" option), you would add,  
 
for example:  
 
for example:  
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
  # Always include the following lines for all PXELINUX clients
+
{|
  site-option-space "pxelinux";
+
|
  option pxelinux.magic f1:00:74:7e;
+
<pre>
  if exists dhcp-parameter-request-list {
+
# Always include the following lines for all PXELINUX clients
    # Always send the PXELINUX options (specified in hexadecimal)
+
site-option-space "pxelinux";
    option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
+
option pxelinux.magic f1:00:74:7e;
  }
+
if exists dhcp-parameter-request-list {
  # These lines should be customized to your setup
+
  # Always send the PXELINUX options (specified in hexadecimal)
  option pxelinux.configfile "configs/common";
+
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
  option pxelinux.pathprefix "/tftpboot/pxelinux/files/";
+
}
  option pxelinux.reboottime 30;
+
# These lines should be customized to your setup
  filename "/tftpboot/pxelinux/pxelinux.bin";
+
option pxelinux.configfile "configs/common";
 +
option pxelinux.pathprefix "/tftpboot/pxelinux/files/";
 +
option pxelinux.reboottime 30;
 +
filename "/tftpboot/pxelinux/pxelinux.bin";
 +
</pre>
 +
|}
  
 
Note that the configfile is relative to the pathprefix:  
 
Note that the configfile is relative to the pathprefix:  
Line 580: Line 592:
 
<!-- as "pre" does not parse wiki markup. -->
 
<!-- as "pre" does not parse wiki markup. -->
  
option magic      code 208 = string;
+
{|
option configfile code 209 = text;
+
|
option pathprefix code 210 = text;
+
  option magic      code 208 = string;
option reboottime code 211 = unsigned integer 32;
+
  option configfile code 209 = text;
 +
  option pathprefix code 210 = text;
 +
  option reboottime code 211 = unsigned integer 32;
 +
|}
  
 
Inside your PXELINUX-booting group or class (wherever you have the  
 
Inside your PXELINUX-booting group or class (wherever you have the  
 
PXELINUX-related options, such as the "filename" option), you would add,  
 
PXELINUX-related options, such as the "filename" option), you would add,  
 
for example:  
 
for example:  
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
  # Always include the following lines for all PXELINUX clients
+
{|
  option magic f1:00:74:7e;
+
|
  if exists dhcp-parameter-request-list {
+
<pre>
    # Always send the PXELINUX options (specified in hexadecimal, ie: 208 = 0xd0, 209 = 0xd1, etc.)
+
# Always include the following lines for all PXELINUX clients
    option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
+
option magic f1:00:74:7e;
  }
+
if exists dhcp-parameter-request-list {
  # These lines should be customized to your setup
+
  # Always send the PXELINUX options (specified in hexadecimal, ie: 208 = 0xd0, 209 = 0xd1, etc.)
  option configfile "configs/common";
+
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
  option pathprefix "/tftpboot/pxelinux/files/";
+
}
  option reboottime 30;
+
# These lines should be customized to your setup
  filename "/tftpboot/pxelinux/pxelinux.bin";
+
option configfile "configs/common";
 +
option pathprefix "/tftpboot/pxelinux/files/";
 +
option reboottime 30;
 +
filename "/tftpboot/pxelinux/pxelinux.bin";
 +
</pre>
 +
|}
  
 
Note that the configfile is relative to the pathprefix:  
 
Note that the configfile is relative to the pathprefix:  
Line 620: Line 636:
 
configuration file name,  
 
configuration file name,  
 
you could do something like:  
 
you could do something like:  
<!-- The following few lines shall start with at least -->
 
<!-- one space character per line for wiki formatting. -->
 
<!-- Do NOT use "pre" tags in the following few lines, -->
 
<!-- as "pre" does not parse wiki markup. -->
 
  
  site-option-space "pxelinux";
+
{|
  option pxelinux.magic f1:00:74:7e;
+
|
  if exists dhcp-parameter-request-list {
+
<pre>
    # Always send the PXELINUX options (specified in hexadecimal)
+
site-option-space "pxelinux";
    option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
+
option pxelinux.magic f1:00:74:7e;
  }
+
if exists dhcp-parameter-request-list {
  option pxelinux.configfile =
+
  # Always send the PXELINUX options (specified in hexadecimal)
    concat("pxelinux.cfg/", binary-to-ascii(16, 8, ":", hardware));
+
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
 +
}
 +
option pxelinux.configfile =
 +
  concat("pxelinux.cfg/", binary-to-ascii(16, 8, ":", hardware));
 
   filename "/tftpboot/pxelinux.bin";
 
   filename "/tftpboot/pxelinux.bin";
 +
</pre>
 +
|}
  
 
If you used this from a client whose Ethernet address was  
 
If you used this from a client whose Ethernet address was  
Line 648: Line 665:
 
<!-- as "pre" does not parse wiki markup. -->
 
<!-- as "pre" does not parse wiki markup. -->
  
 +
{|
 +
|
 
   host trantor-sky2 {
 
   host trantor-sky2 {
    hardware ethernet 00:00:5a:70:c2:71;
+
  hardware ethernet 00:00:5a:70:c2:71;
    vendor-option-space pxelinux;
+
  vendor-option-space pxelinux;
    option pxelinux.magic f1:00:74:7e;
+
  option pxelinux.magic f1:00:74:7e;
    option pxelinux.pathprefix "<nowiki>http://raidtest.hos.anvin.org/tftpboot/</nowiki>";
+
  option pxelinux.pathprefix "<nowiki>http://raidtest.hos.anvin.org/tftpboot/</nowiki>";
    option pxelinux.reboottime 30;
+
  option pxelinux.reboottime 30;
    filename "/pxelinux.0";
+
  filename "/pxelinux.0";
 
   }
 
   }
 +
|}
  
 
That removes the need to muck with the {{nowrap|dhcp-parameter-request-list}}.
 
That removes the need to muck with the {{nowrap|dhcp-parameter-request-list}}.
Line 667: Line 687:
 
<!-- as "pre" does not parse wiki markup. -->
 
<!-- as "pre" does not parse wiki markup. -->
  
 +
{|
 +
|
 
   host trantor-sky2 {
 
   host trantor-sky2 {
    hardware ethernet 00:00:5a:70:c2:71;
+
  hardware ethernet 00:00:5a:70:c2:71;
    option vendor-encapsulated-options
+
  option vendor-encapsulated-options d0:04:f1:00:74:73:d2:23:68:74:74:70:3a:2f:2f:72:61:69:64:74:65:73:74:2e:61:6e:76:69:6e:2e:6f:72:67:2f:74:66:74:70:62:6f:6f:74:2f:d3:04:00:00:00:1e;
      d0:04:f1:00:74:73:
+
  filename "/pxelinux.0";
      d2:23:68:74:74:70:3a:2f:2f:72:61:69:64:74:65:73:74:2e:
+
        61:6e:76:69:6e:2e:6f:72:67:2f:74:66:74:70:62:6f:
+
        6f:74:2f:
+
      d3:04:00:00:00:1e;
+
    filename "/pxelinux.0";
+
 
   }
 
   }
 +
|}
  
 
== Known issues ==
 
== Known issues ==
Line 686: Line 704:
 
<span id="What_Problems_Are_There_Currently_With_PXELINUX.3F"></span>
 
<span id="What_Problems_Are_There_Currently_With_PXELINUX.3F"></span>
  
* <font color="lightgray"><small><s><tt>[-3.63]</tt> <!--
+
* <font color="lightgray"><small><s>{{V|-3.63}} <!--
 
--> Requires a TFTP server with support for the <!--
 
--> Requires a TFTP server with support for the <!--
 
--> {{nowrap|"<tt>tsize</tt>"}} option.</s></small></font>
 
--> {{nowrap|"<tt>tsize</tt>"}} option.</s></small></font>
Line 708: Line 726:
 
kernel files are not named using extensions that have special meanings:  
 
kernel files are not named using extensions that have special meanings:  
  
 +
{|
 +
|
 
   .0    PXE bootstrap program (NBP) [PXELINUX only]
 
   .0    PXE bootstrap program (NBP) [PXELINUX only]
 
   .bin  "CD boot sector" [ISOLINUX only]
 
   .bin  "CD boot sector" [ISOLINUX only]
Line 716: Line 736:
 
   .com  COMBOOT image (runnable from DOS)
 
   .com  COMBOOT image (runnable from DOS)
 
   .img  Disk image [ISOLINUX only]
 
   .img  Disk image [ISOLINUX only]
 +
|}
  
 
=== Broken PXE stacks ===
 
=== Broken PXE stacks ===
Line 782: Line 803:
 
Note 1:  
 
Note 1:  
 
For this example we will use the Simple [[Menu]] System only,  
 
For this example we will use the Simple [[Menu]] System only,  
but it is easy to modify the following procedure so to use  
+
but it is easy to modify the following procedure so as to use  
 
the vesamenu system or no menu.
 
the vesamenu system or no menu.
  
Note 2:
+
Note 2:  
 
For WDS, it is best to run it in Mixed Mode (makes life easier).  
 
For WDS, it is best to run it in Mixed Mode (makes life easier).  
 
Alternatively, see [[WDSLINUX]] for setting it up with WDS only.
 
Alternatively, see [[WDSLINUX]] for setting it up with WDS only.
Line 791: Line 812:
 
On [[RIS]] Server, create the following folder structure:  
 
On [[RIS]] Server, create the following folder structure:  
  
Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\
+
{|
Setup\English\Images\PXELinux\i386\templates\conf
+
|
Setup\English\Images\PXELinux\i386\templates\knl
+
  Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\
Setup\English\Images\PXELinux\i386\templates\img
+
  Setup\English\Images\PXELinux\i386\templates\conf
 +
  Setup\English\Images\PXELinux\i386\templates\knl
 +
  Setup\English\Images\PXELinux\i386\templates\img
 +
|}
  
 
NOTE:  
 
NOTE:  
<tt>Setup\English\Images</tt> is the location of the other RIS images.
+
<tt>Setup\English\Images</tt> is the location of the other RIS images.  
 
You can also change the name PXELinux to anything you want  
 
You can also change the name PXELinux to anything you want  
 
if for example you wish to have a seperate option in RIS for each distro you deploy.
 
if for example you wish to have a seperate option in RIS for each distro you deploy.
Line 809: Line 833:
  
 
<pre>
 
<pre>
vmlinuz
+
vmlinuz
initrd.img
+
initrd.img
 
</pre>
 
</pre>
 
Rename these files to:  
 
Rename these files to:  
 
<pre>
 
<pre>
vmlinuz-<distro>-<arch>
+
vmlinuz-<distro>-<arch>
initrd-<distro>-<arch>.img
+
initrd-<distro>-<arch>.img
 
</pre>
 
</pre>
 
e.g.:  
 
e.g.:  
 
<pre>
 
<pre>
vmlinuz-rhas43-x86
+
vmlinuz-rhas43-x86
initrd-rhas43-x86.img
+
initrd-rhas43-x86.img
 
</pre>
 
</pre>
  
Line 839: Line 863:
  
 
In {{nowrap|"<tt>Setup\English\Images\PXELinux\i386\templates</tt>"}}  
 
In {{nowrap|"<tt>Setup\English\Images\PXELinux\i386\templates</tt>"}}  
create a file "pxelinux.sif" and give it the following Contents:  
+
create a file "pxelinux.sif" and give it the following content:  
  
 +
{|
 +
|
 
   [OSChooser]
 
   [OSChooser]
 
   Description = "Linux"
 
   Description = "Linux"
Line 847: Line 873:
 
   ImageType = Flat
 
   ImageType = Flat
 
   Version="1.01"
 
   Version="1.01"
 +
|}
  
 
In {{nowrap|"<tt>Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\</tt>"}}  
 
In {{nowrap|"<tt>Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\</tt>"}}  
create a file called "default" and give it the following contents:  
+
create a file called "default" and give it the following content:  
  
 
<pre>
 
<pre>
  # Default boot option to use
+
# Default boot option to use
  DEFAULT menu.c32
+
DEFAULT menu.c32
  # Prompt user for selection
+
# Prompt user for selection
  PROMPT 0
+
PROMPT 0
  # Menu Configuration
+
# Menu Configuration
  MENU WIDTH 80
+
MENU WIDTH 80
  MENU MARGIN 10
+
MENU MARGIN 10
  MENU PASSWORDMARGIN 3
+
MENU PASSWORDMARGIN 3
  MENU ROWS 12
+
MENU ROWS 12
  MENU TABMSGROW 18
+
MENU TABMSGROW 18
  MENU CMDLINEROW 18
+
MENU CMDLINEROW 18
  MENU ENDROW 24
+
MENU ENDROW 24
  MENU PASSWORDROW 11
+
MENU PASSWORDROW 11
  MENU TIMEOUTROW 20
+
MENU TIMEOUTROW 20
  MENU TITLE Main Menu
+
MENU TITLE Main Menu
  # Menus
+
# Menus
  # x86
+
# x86
  LABEL x86
+
LABEL x86
    MENU LABEL 32Bit (x86)
+
  MENU LABEL 32Bit (x86)
    KERNEL menu.c32
+
  KERNEL menu.c32
    APPEND conf/x86.conf
+
  APPEND conf/x86.conf
  # x64
+
# x64
  LABEL x64
+
LABEL x64
    MENU LABEL 64Bit (x64)
+
  MENU LABEL 64Bit (x64)
    KERNEL menu.c32
+
  KERNEL menu.c32
    APPEND conf/x64.conf
+
  APPEND conf/x64.conf
 
</pre>
 
</pre>
  
Line 884: Line 911:
 
create a file called {{nowrap|"x86.conf"}}  
 
create a file called {{nowrap|"x86.conf"}}  
 
(this will list all of our 32bit OS installs)  
 
(this will list all of our 32bit OS installs)  
and give it the following contents:  
+
and give it the following content:  
  
 
<pre>
 
<pre>
  # Default boot option to use
+
# Default boot option to use
  DEFAULT menu.c32
+
DEFAULT menu.c32
  # Prompt user for selection
+
# Prompt user for selection
  PROMPT 0
+
PROMPT 0
  # Menu Configuration
+
# Menu Configuration
  MENU WIDTH 80
+
MENU WIDTH 80
  MENU MARGIN 10
+
MENU MARGIN 10
  MENU PASSWORDMARGIN 3
+
MENU PASSWORDMARGIN 3
  MENU ROWS 12
+
MENU ROWS 12
  MENU TABMSGROW 18
+
MENU TABMSGROW 18
  MENU CMDLINEROW 18
+
MENU CMDLINEROW 18
  MENU ENDROW 24
+
MENU ENDROW 24
  MENU PASSWORDROW 11
+
MENU PASSWORDROW 11
  MENU TIMEOUTROW 20
+
MENU TIMEOUTROW 20
  MENU TITLE 32Bit (x86) OS Choice
+
MENU TITLE 32Bit (x86) OS Choice
  # Return to Main Menu
+
# Return to Main Menu
  LABEL MainMenu
+
LABEL MainMenu
    MENU DEFAULT
+
  MENU DEFAULT
    MENU LABEL ^Main Menu
+
  MENU LABEL ^Main Menu
    KERNEL menu.c32
+
  KERNEL menu.c32
  #
+
#
  # Blank boots
+
# Blank boots
  #
+
#
  LABEL linux-43
+
LABEL linux-43
    MENU LABEL ^Blank Boot 4.3
+
  MENU LABEL ^Blank Boot 4.3
    KERNEL knl/vmlinuz-rhas43-x86
+
  KERNEL knl/vmlinuz-rhas43-x86
    APPEND initrd=initrd=img/initrd-rhes43-x86.img
+
  APPEND initrd=initrd=img/initrd-rhes43-x86.img
 
</pre>
 
</pre>
  
Line 920: Line 947:
 
create a file called {{nowrap|"x64.conf"}}  
 
create a file called {{nowrap|"x64.conf"}}  
 
(this will list all of our 64bit OS installs)  
 
(this will list all of our 64bit OS installs)  
and give it the following contents:  
+
and give it the following content:  
  
 
<pre>
 
<pre>
  # Default boot option to use
+
# Default boot option to use
  DEFAULT menu.c32
+
DEFAULT menu.c32
  # Prompt user for selection
+
# Prompt user for selection
  PROMPT 0
+
PROMPT 0
  # Menu Configuration
+
# Menu Configuration
  MENU WIDTH 80
+
MENU WIDTH 80
  MENU MARGIN 10
+
MENU MARGIN 10
  MENU PASSWORDMARGIN 3
+
MENU PASSWORDMARGIN 3
  MENU ROWS 12
+
MENU ROWS 12
  MENU TABMSGROW 18
+
MENU TABMSGROW 18
  MENU CMDLINEROW 18
+
MENU CMDLINEROW 18
  MENU ENDROW 24
+
MENU ENDROW 24
  MENU PASSWORDROW 11
+
MENU PASSWORDROW 11
  MENU TIMEOUTROW 20
+
MENU TIMEOUTROW 20
  MENU TITLE 64Bit (x64) OS Choice
+
MENU TITLE 64Bit (x64) OS Choice
  # Return to Main Menu
+
# Return to Main Menu
  LABEL MainMenu
+
LABEL MainMenu
    MENU DEFAULT
+
  MENU DEFAULT
    MENU LABEL ^Main Menu
+
  MENU LABEL ^Main Menu
    KERNEL menu.c32
+
  KERNEL menu.c32
  #
+
#
  # Blank boots
+
# Blank boots
  #
+
#
  LABEL linux-43
+
LABEL linux-43
    MENU LABEL ^Blank Boot 4.3
+
  MENU LABEL ^Blank Boot 4.3
    KERNEL knl/vmlinuz-rhas43-x64
+
  KERNEL knl/vmlinuz-rhas43-x64
    APPEND initrd=img/initrd-rhes43-x64.img
+
  APPEND initrd=img/initrd-rhes43-x64.img
 
</pre>
 
</pre>
  
Line 962: Line 989:
 
== Custom Menu Example with sub-menus ==
 
== Custom Menu Example with sub-menus ==
  
Many advanced options here.
+
Many advanced options here.  
 
Read full documentation on Syslinux to understand it all.
 
Read full documentation on Syslinux to understand it all.
  
Line 975: Line 1,002:
 
Directory Structure:
 
Directory Structure:
  
    /tftpboot/
+
{|
    /tftpboot/memdisk
+
|
    /tftpboot/pxelinux.0
+
<pre>
    /tftpboot/menu.c32
+
/tftpboot/
   
+
/tftpboot/memdisk
    /tftpboot/pxelinux.cfg/
+
/tftpboot/pxelinux.0
    /tftpboot/pxelinux.cfg/default
+
/tftpboot/menu.c32
    /tftpboot/pxelinux.cfg/graphics.conf
+
    /tftpboot/pxelinux.cfg/fixes.menu
+
/tftpboot/pxelinux.cfg/
    /tftpboot/pxelinux.cfg/setup.menu
+
/tftpboot/pxelinux.cfg/default
   
+
/tftpboot/pxelinux.cfg/graphics.conf
    /tftpboot/TRK/
+
/tftpboot/pxelinux.cfg/fixes.menu
    /tftpboot/TRK/chkdsk.trk
+
/tftpboot/pxelinux.cfg/setup.menu
    /tftpboot/TRK/initrd.trk
+
    /tftpboot/TRK/kernel.trk
+
/tftpboot/TRK/
   
+
/tftpboot/TRK/chkdsk.trk
    /tftpboot/Memtest/memtest.x86
+
/tftpboot/TRK/initrd.trk
   
+
/tftpboot/TRK/kernel.trk
    /tftpboot/Suse/
+
    /tftpboot/Suse/initrd92
+
/tftpboot/Memtest/memtest.x86
    /tftpboot/Suse/linux92
+
   
+
/tftpboot/Suse/
    /tftpboot/Floppy/
+
/tftpboot/Suse/initrd92
    /tftpboot/Floppy/kbfloppy.img
+
/tftpboot/Suse/linux92
 +
 +
/tftpboot/Floppy/
 +
/tftpboot/Floppy/kbfloppy.img
 +
</pre>
 +
|}
  
<tt>/tftpboot/pxelinux.cfg/default</tt>:
+
<tt>/tftpboot/pxelinux.cfg/default</tt>:  
  
  DEFAULT menu.c32
+
{|
  PROMPT 0
+
|
 
+
<pre>
  MENU TITLE PXE Special Boot Menu
+
DEFAULT menu.c32
  MENU INCLUDE pxelinux.cfg/graphics.conf
+
PROMPT 0
  MENU AUTOBOOT Starting Local System in # seconds
+
 
+
MENU TITLE PXE Special Boot Menu
  LABEL bootlocal
+
MENU INCLUDE pxelinux.cfg/graphics.conf
    MENU LABEL ^Boot Point of Sale
+
MENU AUTOBOOT Starting Local System in # seconds
    MENU DEFAULT
+
    LOCALBOOT 0
+
LABEL bootlocal
  TIMEOUT 80
+
  MENU LABEL ^Boot Point of Sale
  TOTALTIMEOUT 9000
+
  MENU DEFAULT
 
+
  LOCALBOOT 0
  LABEL FixesMenu
+
TIMEOUT 80
    MENU LABEL ^Fixes Menu
+
TOTALTIMEOUT 9000
    KERNEL menu.c32
+
    APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/fixes.menu
+
LABEL FixesMenu
 
+
  MENU LABEL ^Fixes Menu
  LABEL SetupMenu
+
  KERNEL menu.c32
    MENU LABEL ^Setup Menu
+
  APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/fixes.menu
    KERNEL menu.c32
+
    APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/setup.menu
+
LABEL SetupMenu
 +
  MENU LABEL ^Setup Menu
 +
  KERNEL menu.c32
 +
  APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/setup.menu
 +
</pre>
 +
|}
  
<tt>/tftpboot/pxelinux.cfg/graphics.conf</tt>:
+
<tt>/tftpboot/pxelinux.cfg/graphics.conf</tt>:  
  
  MENU COLOR TABMSG    37;40 #80ffffff #00000000
+
{|
  MENU COLOR HOTSEL    30;47 #40000000 #20ffffff
+
|
  MENU COLOR SEL      30;47 #40000000 #20ffffff
+
<pre>
  MENU COLOR SCROLLBAR 30;47 #40000000 #20ffffff
+
MENU COLOR TABMSG    37;40 #80ffffff #00000000
  MENU MASTER PASSWD yourpassword
+
MENU COLOR HOTSEL    30;47 #40000000 #20ffffff
  MENU WIDTH 80
+
MENU COLOR SEL      30;47 #40000000 #20ffffff
  MENU MARGIN 22
+
MENU COLOR SCROLLBAR 30;47 #40000000 #20ffffff
  MENU PASSWORDMARGIN 26
+
MENU MASTER PASSWD yourpassword
  MENU ROWS 6
+
MENU WIDTH 80
  MENU TABMSGROW 15
+
MENU MARGIN 22
  MENU CMDLINEROW 15
+
MENU PASSWORDMARGIN 26
  MENU ENDROW 24
+
MENU ROWS 6
  MENU PASSWORDROW 12
+
MENU TABMSGROW 15
  MENU TIMEOUTROW 13
+
MENU CMDLINEROW 15
  MENU VSHIFT 6
+
MENU ENDROW 24
  MENU PASSPROMPT Enter Password:
+
MENU PASSWORDROW 12
  NOESCAPE 1
+
MENU TIMEOUTROW 13
  ALLOWOPTIONS 0
+
MENU VSHIFT 6
 +
MENU PASSPROMPT Enter Password:
 +
NOESCAPE 1
 +
ALLOWOPTIONS 0
 +
</pre>
 +
|}
  
Change <tt>ALLOWOPTIONS</tt> to <tt>1</tt> (one) so to be able  
+
Change <tt>ALLOWOPTIONS</tt> to <tt>1</tt> (one) so as to be able  
 
to edit any of the entries while booted with PXE on the menu system  
 
to edit any of the entries while booted with PXE on the menu system  
 
for testing purposes.  
 
for testing purposes.  
 
Also change <tt>NOESCAPE</tt> to <tt>0</tt> (zero) for the same reasons.
 
Also change <tt>NOESCAPE</tt> to <tt>0</tt> (zero) for the same reasons.
  
<tt>/tftpboot/pxelinux.cfg/fixes.menu</tt>:
+
<tt>/tftpboot/pxelinux.cfg/fixes.menu</tt>:  
  
  MENU TITLE Fixes Menu
+
{|
 
+
|
  LABEL MainMenu
+
<pre>
    MENU LABEL ^Return to Main Menu
+
MENU TITLE Fixes Menu
    KERNEL menu.c32
+
    APPEND pxelinux.cfg/default
+
LABEL MainMenu
 
+
  MENU LABEL ^Return to Main Menu
  LABEL fsck
+
  KERNEL menu.c32
    MENU LABEL ^File system check
+
  APPEND pxelinux.cfg/default
    KERNEL TRK/kernel.trk
+
    APPEND initrd=TRK/chkdsk.trk ramdisk_size=32768 root=/dev/ram0 vga=0
+
LABEL fsck
 
+
  MENU LABEL ^File system check
  LABEL memtest
+
  KERNEL TRK/kernel.trk
    MENU LABEL ^Memory Test: Memtest86+ v1.65
+
  APPEND initrd=TRK/chkdsk.trk ramdisk_size=32768 root=/dev/ram0 vga=0
    KERNEL Memtest/memtest.x86
+
 
+
LABEL memtest
  LABEL trk3
+
  MENU LABEL ^Memory Test: Memtest86+ v1.65
    MENU LABEL ^Trinity Rescue Kit
+
  KERNEL Memtest/memtest.x86
    KERNEL TRK/kernel.trk
+
    APPEND initrd=TRK/initrd.trk ramdisk_size=32768 root=/dev/ram0 vga=0 trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose
+
LABEL trk3
 +
  MENU LABEL ^Trinity Rescue Kit
 +
  KERNEL TRK/kernel.trk
 +
  APPEND initrd=TRK/initrd.trk ramdisk_size=32768 root=/dev/ram0 vga=0 trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose
 +
</pre>
 +
|}
  
<tt>/tftpboot/pxelinux.cfg/setup.menu</tt>:
+
<tt>/tftpboot/pxelinux.cfg/setup.menu</tt>:  
  
 +
{|
 +
|
 
   MENU TITLE Setup Menu
 
   MENU TITLE Setup Menu
 
    
 
    
 
   LABEL MainMenu
 
   LABEL MainMenu
    MENU LABEL ^Return to Main Menu
+
  MENU LABEL ^Return to Main Menu
    KERNEL menu.c32
+
  KERNEL menu.c32
    APPEND pxelinux.cfg/default
+
  APPEND pxelinux.cfg/default
 
    
 
    
 
   LABEL setupkb
 
   LABEL setupkb
    MENU LABEL ^Any floppy disk image
+
  MENU LABEL ^Any floppy disk image
    KERNEL memdisk
+
  KERNEL memdisk
    APPEND initrd=Floppy/kbfloppy.img
+
  APPEND initrd=Floppy/kbfloppy.img
 
    
 
    
 
   LABEL linux
 
   LABEL linux
    MENU PASSWD yourpassword
+
  MENU PASSWD yourpassword
    MENU LABEL Install - ^Classic
+
  MENU LABEL Install - ^Classic
    KERNEL Suse/linux92
+
  KERNEL Suse/linux92
    APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=<nowiki>http://IPADDR</nowiki> serverdir=/9.2/install autoyast=<nowiki>http://IPADDR/9.2/scripts/ay92.xml</nowiki>
+
  APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=<nowiki>http://IPADDR</nowiki> serverdir=/9.2/install autoyast=<nowiki>http://IPADDR/9.2/scripts/ay92.xml</nowiki>
 
    
 
    
 
   LABEL trkclone
 
   LABEL trkclone
    MENU PASSWD yourpassword
+
  MENU PASSWD yourpassword
    MENU LABEL Install - ^Faster
+
  MENU LABEL Install - ^Faster
    KERNEL TRK/kernel.trk
+
  KERNEL TRK/kernel.trk
    APPEND initrd=TRK/initrd.trk ramdisk_size=65536 root=/dev/ram0 vga=0 install=Y trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose
+
  APPEND initrd=TRK/initrd.trk ramdisk_size=65536 root=/dev/ram0 vga=0 install=Y trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose
 
    
 
    
 
   LABEL linuxfull
 
   LABEL linuxfull
    MENU PASSWD yourpassword
+
  MENU PASSWD yourpassword
    MENU LABEL Install - ^Developer
+
  MENU LABEL Install - ^Developer
    KERNEL Suse/linux92
+
  KERNEL Suse/linux92
    APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=<nowiki>http://IPADDR</nowiki> serverdir=/9.2/install autoyast=<nowiki>http://IPADDR/9.2/scripts/develdesktop.xml</nowiki>
+
  APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=<nowiki>http://IPADDR</nowiki> serverdir=/9.2/install autoyast=<nowiki>http://IPADDR/9.2/scripts/develdesktop.xml</nowiki>
 +
|}
  
 
<br />
 
<br />
Line 1,147: Line 1,197:
 
to the following conditions could be used:
 
to the following conditions could be used:
  
 +
{|
 +
|
 
<pre>
 
<pre>
; This one line must be outside any bracketed scope
+
; This one line must be outside any bracketed scope
option architecture-type code 93 = unsigned integer 16;
+
option architecture-type code 93 = unsigned integer 16;
 
+
class "pxeclients" {
+
class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
+
  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
 
+
 
    if option architecture-type = 00:00 {
+
  if option architecture-type = 00:00 {
        filename "path/to/BIOS/pxelinux.0";
+
  filename "path/to/BIOS/pxelinux.0";
    } elsif option architecture-type = 00:09 {
+
  } elsif option architecture-type = 00:09 {
        filename "path/to/EFIx64/syslinux.efi";
+
  filename "path/to/EFIx64/syslinux.efi";
    } elsif option architecture-type = 00:07 {
+
  } elsif option architecture-type = 00:07 {
        filename "path/to/EFIx64/syslinux.efi";
+
  filename "path/to/EFIx64/syslinux.efi";
    } elsif option architecture-type = 00:06 {
+
  } elsif option architecture-type = 00:06 {
        filename "path/to/EFIia32/syslinux.efi";
+
  filename "path/to/EFIia32/syslinux.efi";
    }
+
  }
}
+
}
 
</pre>
 
</pre>
 +
|}
  
 
About "architecture-type":
 
About "architecture-type":
Line 1,172: Line 1,225:
 
* Each bootloader needs its respective {{nowrap|"<tt>ldlinux.*</tt>"}} module too:
 
* Each bootloader needs its respective {{nowrap|"<tt>ldlinux.*</tt>"}} module too:
  
path/to/BIOS/ldlinux.c32
+
  path/to/BIOS/ldlinux.c32
path/to/EFIia32/ldlinux.e32
+
  path/to/EFIia32/ldlinux.e32
path/to/EFIx64/ldlinux.e64
+
  path/to/EFIx64/ldlinux.e64
  
 
Alternatively,  
 
Alternatively,  
Line 1,182: Line 1,235:
 
rather than requiring changes to DHCP:
 
rather than requiring changes to DHCP:
  
 +
{|
 +
|
 
<pre>
 
<pre>
class "pxeclients" {
+
class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
+
  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
 
+
    filename concat("path/to/PXE-",  binary-to-ascii(16, 16, "", option architecture-type), "/pxelinux.0");
+
  filename concat("path/to/PXE-",  binary-to-ascii(16, 16, "", option architecture-type), "/pxelinux.0");
}
+
}
 
</pre>
 
</pre>
 +
|}
  
 
* The respective [[library modules]] for each firmware <!--
 
* The respective [[library modules]] for each firmware <!--
Line 1,203: Line 1,259:
 
* Optionally, use additional directives, such as <!--
 
* Optionally, use additional directives, such as <!--
 
--> [[Config#INCLUDE|INCLUDE]] {{nowrap|and/or}} <!--
 
--> [[Config#INCLUDE|INCLUDE]] {{nowrap|and/or}} <!--
--> [[Config#CONFIG|CONFIG]], so to share {{nowrap|in-common}} <!--
+
--> [[Config#CONFIG|CONFIG]], so as to share {{nowrap|in-common}} <!--
 
--> Syslinux configuration files.
 
--> Syslinux configuration files.
  

Latest revision as of 02:36, 18 November 2019


Description

PXELINUX is a Syslinux derivative, for booting from a network server using a network ROM conforming to the Intel PXE (Pre-Execution Environment) specification. PXELINUX is not a program intended to be flashed or burned into a PROM on the network card. For such possibility, check out iPXE (http://ipxe.org/).

If you want to create PXE-compliant boot PROM for your network card (to use with PXELINUX, for example), check out NetBoot (http://netboot.sourceforge.net/).

Working directory

The initial Current Working Directory is either as supplied by DHCP option 210 (pxelinux.pathprefix), the hardcoded path-prefix or the parent directory of the PXELINUX file, as indicated by DHCP fields sname and file (sname="192.168.2.3" and file="boot/pxelinux.0" result in "tftp://192.168.2.3/boot/", or in "192.168.2.3::boot/" in older PXELINUX format) with the precedence as specified under the #Options section of this document.

All unqualified filenames are relative to the Current Working Directory.

Configuration

The basic configuration is the same for all Syslinux variants. This document explains only some of the differences specifically applicable to PXELINUX.

On the TFTP server, create the directory "/tftpboot", and copy "pxelinux.0" (from the Syslinux distribution) and any kernel or initrd images that you want to boot.

[5.00+] Also copy "ldlinux.c32" from the Syslinux distribution to the "/tftpboot" directory on the TFTP server.

Finally, create the directory "/tftpboot/pxelinux.cfg". The configuration file (equivalent of syslinux.cfg -- see the SYSLINUX FAQ for the options here) will live in this directory.

Because more than one system may be booted from the same server, the configuration file name depends on the IP address of the booting machine.

Before a generic explanation, let's see first an example. When:

  • the bootloader file name is "/mybootdir/pxelinux.0"; and,
  • the client UUID is "b8945908-d6a6-41a9-611d-74a6ab80b83d"; and,
  • the Ethernet MAC address is "88:99:AA:BB:CC:DD"; and,
  • the IP address is "192.168.2.91", or in uppercase hexadecimal, "C0A8025B";

then PXELINUX will try the following configuration files (in this order):

 /mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
 /mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
 /mybootdir/pxelinux.cfg/C0A8025B
 /mybootdir/pxelinux.cfg/C0A8025
 /mybootdir/pxelinux.cfg/C0A802
 /mybootdir/pxelinux.cfg/C0A80
 /mybootdir/pxelinux.cfg/C0A8
 /mybootdir/pxelinux.cfg/C0A
 /mybootdir/pxelinux.cfg/C0
 /mybootdir/pxelinux.cfg/C
 /mybootdir/pxelinux.cfg/default

Let's see now what exactly the above example represents.

After attempting the file as specified in the DHCP or hardcoded options, PXELINUX will probe the following paths, prefixed with "pxelinux.cfg/", under the initial Working Directory.

  • The client UUID, if provided by the PXE stack.
Note that some BIOSes do not have a valid UUID, and it might end up reporting something like all 1's.
This value is represented in the standard UUID format using lowercase hexadecimal digits, e.g. "b8945908-d6a6-41a9-611d-74a6ab80b83d".
  • The hardware type (using its ARP type code) and address, all in lowercase hexadecimal with dash separators.
For example, for an Ethernet (ARP type "1") with address "88:99:AA:BB:CC:DD", it would search for the filename "01-88-99-aa-bb-cc-dd".
  • The client's own IPv4 address in uppercase hexadecimal, followed by removing hex characters, one at a time, from the end. For example, "192.168.2.91" → "C0A8025B".
The included program, "gethostip", can be used to compute the hexadecimal IP address for any host.
  • Lowercase "default".


Note that all references to filenames are relative to the directory in which "pxelinux.0" lives.

PXELINUX generally requires for filenames (including any relative path) to be 127 characters or shorter in length.

[3.20+] If PXELINUX cannot find a configuration file, it will reboot after the timeout interval has expired. This keeps a machine from getting stuck indefinitely due to a boot server failure.

Options

[1.62+] Depending on the specific DHCP server, the following nonstandard DHCP options might be available so as to customize the specific behaviour of PXELINUX. See RFC 5071 for some additional information about these options. Options for PXELINUX can be specified by DHCP options, or hardcoded into the binary.

Option priority

Hardcoded "after-options" are applied after DHCP options (and override them) while hardcoded "before-options" are applied prior to DHCP options. The default behavior takes the lowest priority.

DHCP options

Option 208 pxelinux.magic
Earlier versions of PXELINUX required this option to be set to F1:00:74:7E (241.0.116.126) for PXELINUX to be able to recognize any special DHCP options whatsoever. As of PXELINUX 3.55, this option is deprecated and is no longer required.
Option 209 pxelinux.configfile
Specify the initial PXELINUX configuration file name, which may be qualified or unqualified.
Option 210 pxelinux.pathprefix
Specify the PXELINUX common path prefix, instead of deriving it from the boot file name. This almost certainly needs to end in whatever character the TFTP server OS uses as a pathname separator, e.g. slash (/) for Unix.
Option 211 pxelinux.reboottime
Specify, in seconds, the time to wait before reboot in the event of TFTP failure. "0" (zero) means wait "forever" (in reality, it waits approximately 136 years).


Hardcoded options

[3.83+] The program "pxelinux-options" can be used to hard-code DHCP options into the "pxelinux.0" image file. This is sometimes useful when the DHCP server is under different administrative control.

Hardcoded options:

   6 => 'domain-name-servers',
  15 => 'domain-name',
  54 => 'next-server',
 209 => 'config-file',
 210 => 'path-prefix',
 211 => 'reboottime'

HTTP and FTP

Older versions of PXELINUX supported HTTP by using a hybrid bootloader that also contained gPXE/iPXE, with such images named either gpxelinux.0 or ipxelinux.0.

Since version 5.10, a special PXELINUX binary, lpxelinux.0, natively supports HTTP and FTP transfers, greatly increasing load speed and allowing for standard HTTP scripts to present PXELINUX's configuration file. To use HTTP or FTP, use standard URL syntax as filename; use DHCP options to transmit a suitable URL prefix to the client, or use the "pxelinux-options" tool provided in the "utils" directory to program it directly into the lpxelinux.0 file.

While using HTTP/FTP (syntax), trying to use pxelinux.0 (i.e. without the letter "l" prefix) without iPXE/gPXE running underneath, will result in a "file not found" warning without any explanation as to the cause!

Example:

 LABEL linux-http
 LINUX http://boot-server/boot/mykernel
 APPEND initrd=http://boot-server/boot/myinitrd

Filename syntax

PXELINUX supports the following special pathname conventions:

::filename
Suppress the common filename prefix, i.e. passes the string "filename" unmodified to the server.
IP address::filename
(e.g. 192.168.2.3::filename)
Suppress the common filename prefix, and send a request to an alternate TFTP server.
Instead of an IP address, a DNS name can be used.
It will be assumed to be fully qualified if it contains dots; otherwise the local domain as reported by the DHCP server (option 15) will be added.

The double colon symbol ("::") was chosen because it is unlikely to conflict with operating system usage. However, if you happen to have an environment for which the special treatment of "::" is a problem, please contact the Syslinux mailing list.

[4.00+] PXELINUX also supports standard URL syntax.

Keeppxe

Normally, PXELINUX will unload the PXE and UNDI stacks before invoking the kernel. In special circumstances (for example, when using MEMDISK to boot an operating system with an UNDI network driver) it might be desirable to keep the PXE stack in memory. If the option "keeppxe" is given on the kernel command line, then PXELINUX will keep the PXE and UNDI stacks in memory. (If you don't know what this means, you probably don't need it.)

Examples

Configuration filename

For DHCP siaddr "192.168.2.3", file "mybootdir/pxelinux.0", client UUID "b8945908-d6a6-41a9-611d-74a6ab80b83d", Ethernet MAC address "88:99:AA:BB:CC:DD" and IPv4 address "192.168.2.91", the following files will be attempted in this order (after "config-file" options):

 mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
 mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
 mybootdir/pxelinux.cfg/C0A8025B
 mybootdir/pxelinux.cfg/C0A8025
 mybootdir/pxelinux.cfg/C0A802
 mybootdir/pxelinux.cfg/C0A80
 mybootdir/pxelinux.cfg/C0A8
 mybootdir/pxelinux.cfg/C0A
 mybootdir/pxelinux.cfg/C0
 mybootdir/pxelinux.cfg/C
 mybootdir/pxelinux.cfg/default

TFTP servers

For best results, use a TFTP server with support for the "tsize" TFTP option (RFC 1784/RFC 2349).

Please check out the Hardware Compatibility reference page to see if your PXE stacks need any special workarounds.

Some TFTP servers that have been successfully used with PXELINUX include:

  • The "tftp-hpa" TFTP server (highly portable and port of the BSD TFTP server code) supports options and is available at:

http://www.kernel.org/pub/software/network/tftp/ or ftp://ftp.kernel.org/pub/software/network/tftp/

and on any kernel.org mirror (http://www.kernel.org/mirrors/).
  • Another TFTP server supporting options is "atftp" by Jean-Pierre Lefebvre:

ftp://ftp.mamalinux.com/pub/atftp/

atftp is likely going to perform better than "tftp-hpa" on a large boot server, but may not be quite as widely portable.
  • If your boot server is running Windows (and you can't change that), try "tftpd32" by Philippe Jounin (you need version 2.11 or later; previous versions had a bug which made it incompatible with PXELINUX):

http://tftpd32.jounin.net/

  • Eric Cook of Intel also reports that the TFTPD server from Win2000 Server RIS can be used:

The trick is to install RIS, but don't configure it with the GUI. Instead, do the following:
In the registry, add the folder \HKLM\System\CurrentControlSet\Services\TFTPD\Parameters.
In the Parameters folder, add a key called Directory, with a value of the TFTP root directory path. With the Services GUI, configure the TFTPD service for Automatic start and start it. If you DO configure the RIS in Win2k, you end up with the MS PXE stuff, which is ugly to get rid of.

However, Christian "Dr. Disk" Hechelmann reports having success with using the Windows RIS as-is, and has sent a nice writeup on how to set it up. See Windows Remote Install System.


DHCP config - Simple

The PXE protocol uses a very complex set of extensions to DHCP or BOOTP. However, most PXE implementations -- this includes all Intel ones version 0.99n and later -- seem to be able to boot in a "conventional" DHCP/TFTP configuration. Assuming you don't have to support any very old or otherwise severely broken clients, this is probably the best configuration unless you already have a PXE boot server on your network.

A sample DHCP setup, using the "conventional TFTP" configuration, would look something like the following, using ISC dhcp (2.0 or later) "dhcpd.conf" syntax:

 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;
  }
 }

Note that if your particular TFTP daemon runs under chroot (tftp-hpa will do this if you specify the "-s" (secure) option; this is highly recommended), you almost certainly should not include the /tftpboot prefix in the filename statement.

DHCP Config - PXE-1

If the simple config does not work for your environment, you probably should set up a "PXE boot server" on port 4011 of your TFTP server; a free PXE boot server is available at: http://www.kano.org.uk/projects/pxe/

With such a boot server defined, your DHCP configuration should look the same except for an "option dhcp-class-identifier" (ISC dhcp 2) or "option vendor-class-identifier" (ISC dhcp 3):

 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...
  option dhcp-class-identifier "PXEClient";
  next-server pxe_boot_server_address;
  
  # You need an entry like this for every host
  # unless you're using dynamic addresses
  host hostname {
   hardware ethernet ethernet_address;
   fixed-address hostname;
  }
 }

Here, the boot file name is obtained from the PXE server.

DHCP Config - Encapsulated

If the "conventional TFTP" configuration doesn't work on your clients, and setting up a PXE boot server is not an option, you can attempt the following configuration. It has been known to boot some configurations correctly; however, there are no guarantees:

 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...
  option dhcp-class-identifier "PXEClient";
  option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62:6f:6f:74:0a:07:00:50:72:6f:6d:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00:00:ff;
  next-server TFTP_server;
  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;
  }
 }

Note that this will not boot some clients that will boot with the "conventional TFTP" configuration; Intel Boot Client 3.0 and later are known to fall into this category.

DHCP Config - ISC dhcpd options

ISC dhcp 3.0 supports a rather nice syntax for specifying custom options. The following syntax can be used in "dhcpd.conf" if you are running this version of dhcpd:

 option space pxelinux;
 option pxelinux.magic      code 208 = string;
 option pxelinux.configfile code 209 = text;
 option pxelinux.pathprefix code 210 = text;
 option pxelinux.reboottime code 211 = unsigned integer 32;

Note: In earlier versions of PXELINUX, this would only work as a "site-option-space". Since PXELINUX 2.07, this will work both as a "site-option-space" (unencapsulated) and as a "vendor-option-space" (type 43 encapsulated). This may avoid messing with the "dhcp-parameter-request-list", as detailed below.

[PXELINUX 2.07+] This is supported both as a "site-option-space", and as a "vendor-option-space".

Inside your PXELINUX-booting group or class (wherever you have the PXELINUX-related options, such as the "filename" option), you would add, for example:

 # Always include the following lines for all PXELINUX clients
 site-option-space "pxelinux";
 option pxelinux.magic f1:00:74:7e;
 if exists dhcp-parameter-request-list {
  # Always send the PXELINUX options (specified in hexadecimal)
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
 }
 # These lines should be customized to your setup
 option pxelinux.configfile "configs/common";
 option pxelinux.pathprefix "/tftpboot/pxelinux/files/";
 option pxelinux.reboottime 30;
 filename "/tftpboot/pxelinux/pxelinux.bin";

Note that the configfile is relative to the pathprefix: this will look for a config file called /tftpboot/pxelinux/files/configs/common on the TFTP server.

The "option dhcp-parameter-request-list" statement forces the DHCP server to send the PXELINUX-specific options, even though they are not explicitly requested. Since the DHCP request is done before PXELINUX is loaded, the PXE client won't know to request them.

In ISC dhcp versions greater than 3.0, site-local option spaces start at 224, not 128 (to be compliant with RFC 3942), so you should define the PXELINUX options 208-211 as regular DHCP options, rather than site local ones. For example:

 option magic      code 208 = string;
 option configfile code 209 = text;
 option pathprefix code 210 = text;
 option reboottime code 211 = unsigned integer 32;

Inside your PXELINUX-booting group or class (wherever you have the PXELINUX-related options, such as the "filename" option), you would add, for example:

 # Always include the following lines for all PXELINUX clients
 option magic f1:00:74:7e;
 if exists dhcp-parameter-request-list {
  # Always send the PXELINUX options (specified in hexadecimal, ie: 208 = 0xd0, 209 = 0xd1, etc.)
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
 }
 # These lines should be customized to your setup
 option configfile "configs/common";
 option pathprefix "/tftpboot/pxelinux/files/";
 option reboottime 30;
 filename "/tftpboot/pxelinux/pxelinux.bin";

Note that the configfile is relative to the pathprefix: this will look for a config file called /tftpboot/pxelinux/files/configs/common on the TFTP server.

The "option dhcp-parameter-request-list" statement forces the DHCP server to send the PXELINUX-specific options, even though they are not explicitly requested. Since the DHCP request is done before PXELINUX is loaded, the PXE client won't know to request them.

Using ISC dhcp 3.0 you can create a lot of these strings on the fly. For example, to use the hexadecimal form of the hardware address as the configuration file name, you could do something like:

 site-option-space "pxelinux";
 option pxelinux.magic f1:00:74:7e;
 if exists dhcp-parameter-request-list {
  # Always send the PXELINUX options (specified in hexadecimal)
  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
 }
 option pxelinux.configfile =
  concat("pxelinux.cfg/", binary-to-ascii(16, 8, ":", hardware));
  filename "/tftpboot/pxelinux.bin";

If you used this from a client whose Ethernet address was 58:FA:84:CF:55:0E, this would look for a configuration file named "/tftpboot/pxelinux.cfg/1:58:fa:84:cf:55:e".

vendor options

 host trantor-sky2 {
  hardware ethernet 00:00:5a:70:c2:71;
  vendor-option-space pxelinux;
  option pxelinux.magic f1:00:74:7e;
  option pxelinux.pathprefix "http://raidtest.hos.anvin.org/tftpboot/";
  option pxelinux.reboottime 30;
  filename "/pxelinux.0";
 }

That removes the need to muck with the dhcp-parameter-request-list.

vendor options - handcrafted

 host trantor-sky2 {
  hardware ethernet 00:00:5a:70:c2:71;
  option vendor-encapsulated-options d0:04:f1:00:74:73:d2:23:68:74:74:70:3a:2f:2f:72:61:69:64:74:65:73:74:2e:61:6e:76:69:6e:2e:6f:72:67:2f:74:66:74:70:62:6f:6f:74:2f:d3:04:00:00:00:1e;
  filename "/pxelinux.0";
 }

Known issues

  • [-3.63] Requires a TFTP server with support for the "tsize" option.
  • The error recovery routine doesn't work quite right. For now, it just does a hard reset - seems good enough.
  • We should probably call the UDP receive function in the keyboard entry loop, so that we answer ARP requests.
  • Boot sectors/disk images are not supported yet... They probably need auxilliary information (such as device) to work at all.


If you have additional problems, please contact the Syslinux mailing list. Before you post something, please make sure you have checked that your kernel files are not named using extensions that have special meanings:

 .0    PXE bootstrap program (NBP) [PXELINUX only]
 .bin  "CD boot sector" [ISOLINUX only]
 .bs   Boot sector [SYSLINUX only]
 .bss  Boot sector, DOS superblock will be patched in [SYSLINUX only]
 .c32  COM32 image (32-bit COMBOOT)
 .cbt  COMBOOT image (not runnable from DOS)
 .com  COMBOOT image (runnable from DOS)
 .img  Disk image [ISOLINUX only]

Broken PXE stacks

Lots of PXE stacks, especially old ones, have various problems of varying degrees of severity. Please check out the Hardware Compatibility reference page for possible workarounds.


PXE stack on a floppy

If your network card doesn't have a PXE boot ROM, there are a couple of PXE stacks available.

Etherboot is a ROM kit that allows you to create your own PXE boot ROM (version 5.3.7 or later required), as well as make one that can be run from a boot floppy. The Etherboot home page is at: http://www.etherboot.org/
... and you can use ROM-o-matic to automatically create customized boot ROMs for your needs. See: http://rom-o-matic.net/

NetBoot is a ROM kit that may allow you to create your own PXE boot ROM, and possibly also run one from a floppy. It is available at: http://netboot.sourceforge.net/

A multi-hardware boot floppy is included with Windows Server 2000 and 2003. A company called Argon Technology used to offer a free-as-in-beer updated version, but it seems to have gone fully commercial. This floppy (which can also be burned to a CD using El Torito in floppy-emulation mode), is known to work with PXELINUX 2.03 or later only.

Deploy Linux from Windows WDS/RIS server using PXELinux

Note 1: For this example we will use the Simple Menu System only, but it is easy to modify the following procedure so as to use the vesamenu system or no menu.

Note 2: For WDS, it is best to run it in Mixed Mode (makes life easier). Alternatively, see WDSLINUX for setting it up with WDS only.

On RIS Server, create the following folder structure:

 Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\
 Setup\English\Images\PXELinux\i386\templates\conf
 Setup\English\Images\PXELinux\i386\templates\knl
 Setup\English\Images\PXELinux\i386\templates\img

NOTE: Setup\English\Images is the location of the other RIS images. You can also change the name PXELinux to anything you want if for example you wish to have a seperate option in RIS for each distro you deploy.

Download the latest version of Syslinux from: http://www.kernel.org/pub/linux/utils/boot/syslinux/

From Redhat AS4u3 CD1 (or cd of the distro you wish to deploy), in the directory "images\pxeboot" copy the following files into "Setup\English\Images\PXELinux\i386\templates" on the RIS server.

 vmlinuz
 initrd.img

Rename these files to:

 vmlinuz-<distro>-<arch>
 initrd-<distro>-<arch>.img

e.g.:

 vmlinuz-rhas43-x86
 initrd-rhas43-x86.img

Place the renamed "vmlinuz" file in the folder "\knl". Place the renamed "initrd.img" file in the folder "\img".

NOTE: You must use the files vmlinuz and initrd.img from the distro version you intend to deploy (although sometimes you can get away with using older or newer ones for older / newer versions).

From the Syslinux distribution file downloaded, extract the file "pxelinux.0" (and, since version 5.00, also extract the corresponding "ldlinux.c32" file) to "Setup\English\Images\PXELinux\i386\templates" on the RIS server.

In "Setup\English\Images\PXELinux\i386\templates" create a file "pxelinux.sif" and give it the following content:

 [OSChooser]
 Description = "Linux"
 Help = "This option runs a Linux installer."
 LaunchFile = "Setup\English\Images\PXELinux\i386\templates\pxelinux.0"
 ImageType = Flat
 Version="1.01"

In "Setup\English\Images\PXELinux\i386\templates\pxelinux.cfg\" create a file called "default" and give it the following content:

 # Default boot option to use
 DEFAULT menu.c32
 # Prompt user for selection
 PROMPT 0
 # Menu Configuration
 MENU WIDTH 80
 MENU MARGIN 10
 MENU PASSWORDMARGIN 3
 MENU ROWS 12
 MENU TABMSGROW 18
 MENU CMDLINEROW 18
 MENU ENDROW 24
 MENU PASSWORDROW 11
 MENU TIMEOUTROW 20
 MENU TITLE Main Menu
 # Menus
 # x86
 LABEL x86
  MENU LABEL 32Bit (x86)
  KERNEL menu.c32
  APPEND conf/x86.conf
 # x64
 LABEL x64
  MENU LABEL 64Bit (x64)
  KERNEL menu.c32
  APPEND conf/x64.conf

In "Setup\English\Images\PXELinux\i386\templates\conf\" create a file called "x86.conf" (this will list all of our 32bit OS installs) and give it the following content:

 # Default boot option to use
 DEFAULT menu.c32
 # Prompt user for selection
 PROMPT 0
 # Menu Configuration
 MENU WIDTH 80
 MENU MARGIN 10
 MENU PASSWORDMARGIN 3
 MENU ROWS 12
 MENU TABMSGROW 18
 MENU CMDLINEROW 18
 MENU ENDROW 24
 MENU PASSWORDROW 11
 MENU TIMEOUTROW 20
 MENU TITLE 32Bit (x86) OS Choice
 # Return to Main Menu
 LABEL MainMenu
  MENU DEFAULT
  MENU LABEL ^Main Menu
  KERNEL menu.c32
 #
 # Blank boots
 #
 LABEL linux-43
  MENU LABEL ^Blank Boot 4.3
  KERNEL knl/vmlinuz-rhas43-x86
  APPEND initrd=initrd=img/initrd-rhes43-x86.img

In "Setup\English\Images\PXELinux\i386\templates\conf\" create a file called "x64.conf" (this will list all of our 64bit OS installs) and give it the following content:

 # Default boot option to use
 DEFAULT menu.c32
 # Prompt user for selection
 PROMPT 0
 # Menu Configuration
 MENU WIDTH 80
 MENU MARGIN 10
 MENU PASSWORDMARGIN 3
 MENU ROWS 12
 MENU TABMSGROW 18
 MENU CMDLINEROW 18
 MENU ENDROW 24
 MENU PASSWORDROW 11
 MENU TIMEOUTROW 20
 MENU TITLE 64Bit (x64) OS Choice
 # Return to Main Menu
 LABEL MainMenu
  MENU DEFAULT
  MENU LABEL ^Main Menu
  KERNEL menu.c32
 #
 # Blank boots
 #
 LABEL linux-43
  MENU LABEL ^Blank Boot 4.3
  KERNEL knl/vmlinuz-rhas43-x64
  APPEND initrd=img/initrd-rhes43-x64.img

Now if you Boot to your RIS server, on the OS list screen you should see one called Linux. Choosing this will boot PXELinux and take you to the main menu to choose your arch type and then the distro you would like to install.

Using the new Syslinux features for vesamenu can make for a very easy to use and pleasant interface.

Custom Menu Example with sub-menus

Many advanced options here. Read full documentation on Syslinux to understand it all.

Its password protected from modification during PXE boot, very useful to prevent tampering.

Note: this example uses the legacy way to generate submenus, which is compatible with older Syslinux versions. Syslinux 3.62 supports a slightly different syntax, which is faster and somewhat more flexible.

Directory Structure:

 /tftpboot/
 /tftpboot/memdisk
 /tftpboot/pxelinux.0
 /tftpboot/menu.c32
 
 /tftpboot/pxelinux.cfg/
 /tftpboot/pxelinux.cfg/default
 /tftpboot/pxelinux.cfg/graphics.conf
 /tftpboot/pxelinux.cfg/fixes.menu
 /tftpboot/pxelinux.cfg/setup.menu
 
 /tftpboot/TRK/
 /tftpboot/TRK/chkdsk.trk
 /tftpboot/TRK/initrd.trk
 /tftpboot/TRK/kernel.trk
 
 /tftpboot/Memtest/memtest.x86
 
 /tftpboot/Suse/
 /tftpboot/Suse/initrd92
 /tftpboot/Suse/linux92
 
 /tftpboot/Floppy/
 /tftpboot/Floppy/kbfloppy.img

/tftpboot/pxelinux.cfg/default:

 DEFAULT menu.c32
 PROMPT 0
 
 MENU TITLE PXE Special Boot Menu
 MENU INCLUDE pxelinux.cfg/graphics.conf
 MENU AUTOBOOT Starting Local System in # seconds
 
 LABEL bootlocal
  MENU LABEL ^Boot Point of Sale
  MENU DEFAULT
  LOCALBOOT 0
 TIMEOUT 80
 TOTALTIMEOUT 9000
 
 LABEL FixesMenu
  MENU LABEL ^Fixes Menu
  KERNEL menu.c32
  APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/fixes.menu
 
 LABEL SetupMenu
  MENU LABEL ^Setup Menu
  KERNEL menu.c32
  APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/setup.menu

/tftpboot/pxelinux.cfg/graphics.conf:

 MENU COLOR TABMSG    37;40 	#80ffffff #00000000
 MENU COLOR HOTSEL    30;47 	#40000000 #20ffffff
 MENU COLOR SEL       30;47 	#40000000 #20ffffff
 MENU COLOR SCROLLBAR 30;47 	#40000000 #20ffffff
 MENU MASTER PASSWD yourpassword
 MENU WIDTH 80
 MENU MARGIN 22
 MENU PASSWORDMARGIN 26
 MENU ROWS 6
 MENU TABMSGROW 15
 MENU CMDLINEROW 15
 MENU ENDROW 24
 MENU PASSWORDROW 12
 MENU TIMEOUTROW 13
 MENU VSHIFT 6
 MENU PASSPROMPT Enter Password:
 NOESCAPE 1
 ALLOWOPTIONS 0

Change ALLOWOPTIONS to 1 (one) so as to be able to edit any of the entries while booted with PXE on the menu system for testing purposes. Also change NOESCAPE to 0 (zero) for the same reasons.

/tftpboot/pxelinux.cfg/fixes.menu:

 MENU TITLE Fixes Menu
 
 LABEL MainMenu
  MENU LABEL ^Return to Main Menu
  KERNEL menu.c32
  APPEND pxelinux.cfg/default
 
 LABEL fsck
  MENU LABEL ^File system check
  KERNEL TRK/kernel.trk
  APPEND initrd=TRK/chkdsk.trk ramdisk_size=32768 root=/dev/ram0 vga=0
 
 LABEL memtest
  MENU LABEL ^Memory Test: Memtest86+ v1.65
  KERNEL Memtest/memtest.x86
 
 LABEL trk3
  MENU LABEL ^Trinity Rescue Kit
  KERNEL TRK/kernel.trk
  APPEND initrd=TRK/initrd.trk ramdisk_size=32768 root=/dev/ram0 vga=0 trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose

/tftpboot/pxelinux.cfg/setup.menu:

 MENU TITLE Setup Menu
 
 LABEL MainMenu
  MENU LABEL ^Return to Main Menu
  KERNEL menu.c32
  APPEND pxelinux.cfg/default
 
 LABEL setupkb
  MENU LABEL ^Any floppy disk image
  KERNEL memdisk
  APPEND initrd=Floppy/kbfloppy.img
 
 LABEL linux
  MENU PASSWD yourpassword
  MENU LABEL Install - ^Classic
  KERNEL Suse/linux92
  APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=http://IPADDR serverdir=/9.2/install autoyast=http://IPADDR/9.2/scripts/ay92.xml
 
 LABEL trkclone
  MENU PASSWD yourpassword
  MENU LABEL Install - ^Faster
  KERNEL TRK/kernel.trk
  APPEND initrd=TRK/initrd.trk ramdisk_size=65536 root=/dev/ram0 vga=0 install=Y trknfs=IPADDR:/trk ip=::::::dhcp splash=verbose
 
 LABEL linuxfull
  MENU PASSWD yourpassword
  MENU LABEL Install - ^Developer
  KERNEL Suse/linux92
  APPEND initrd=Suse/initrd92 ramdisk_size=65536 vga=0 textmode=1 install=http://IPADDR serverdir=/9.2/install autoyast=http://IPADDR/9.2/scripts/develdesktop.xml


Notes

Error recovery

If the boot fails, PXELINUX (unlike SYSLINUX) will not wait forever; rather, if it has not received any input for approximately five minutes after displaying an error message, it will reset the machine. This allows an unattended machine to recover in case it had bad enough luck of trying to boot at the same time the TFTP server goes down.

Please check out the Hardware Compatibility reference page to see if your PXE stacks need any special workarounds.

MTFTP

PXELINUX does not support MTFTP, and there are no plans of doing so. It is of course possible to use MTFTP for the initial boot, if you have such a setup. MTFTP server setup is beyond the scope of this document.

UEFI

The "(l)pxelinux.0" bootloaders are capable of netbooting BIOS-based clients. Hardware using UEFI has to use the adequate "syslinux.efi" (for EFI IA32 or for EFI X64, respectively) instead of using "(l)pxelinux.0".

For example, in the dhcp configuration file, something similar to the following conditions could be used:

 ; This one line must be outside any bracketed scope
 option architecture-type code 93 = unsigned integer 16;
 
 class "pxeclients" {
  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
  
  if option architecture-type = 00:00 {
   filename "path/to/BIOS/pxelinux.0";
  } elsif option architecture-type = 00:09 {
   filename "path/to/EFIx64/syslinux.efi";
  } elsif option architecture-type = 00:07 {
   filename "path/to/EFIx64/syslinux.efi";
  } elsif option architecture-type = 00:06 {
   filename "path/to/EFIia32/syslinux.efi";
  }
 }

About "architecture-type":

  • 06 (EFI IA32) is sometimes (mis)used for legacy (CSM) boot of x64 machines by some vendors.
  • 07 (EFI BC) is sometimes (mis)used for EFI x64 boot by some vendors.
  • Each bootloader needs its respective "ldlinux.*" module too:
 path/to/BIOS/ldlinux.c32
 path/to/EFIia32/ldlinux.e32
 path/to/EFIx64/ldlinux.e64

Alternatively, the PXE directory can be organized by architecture number. This allows the namespace to be managed on the TFTP server (usually with symlinks), rather than requiring changes to DHCP:

 class "pxeclients" {
  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
 
  filename concat("path/to/PXE-",  binary-to-ascii(16, 16, "", option architecture-type), "/pxelinux.0");
 }
  • The respective library modules for each firmware (if they are needed), cannot share the same directory between each other, since they have the same file name. Use individual configuration files for each architecture/firmware, and if necessary also add a relevant PATH directive in each of them.
  • The parent directory for the network bootloaders could be the same for all of them, if each bootloader is named differently. In such case, relevant PATH directives might be needed.
  • Optionally, use additional directives, such as INCLUDE and/or CONFIG, so as to share in-common Syslinux configuration files.

Notes:

  • Instead of "pxelinux.0", the alternative "lpxelinux.0" (with initial lowercase letter "L") can be used for BIOS clients.
  • The "syslinux.efi" file for EFI IA32 is different from the one for EFI X64; each architecture/firmware has its own "syslinux.efi".
  • The "syslinux.efi" file for EFI X64 is the same binary for disk booting EFI X64 and for network booting EFI X64.
  • The "syslinux.efi" file for EFI IA32 is the same binary for disk booting EFI IA32 and for network booting EFI IA32.
  • Each "syslinux.efi" file can be renamed (e.g. to "bootx64.efi"); just beware to use the adequate path(s) and name(s) in the dhcp configuration file.

Resources

  • RFC 2132 - March 1997 - DHCP Options and BOOTP Vendor Extensions
  • RFC 4578 - November 2006 - DHCP Options for PXE
  • RFC 5071 - December 2007 - DHCP Options used by PXELINUX
  • RFC 5494 - April 2009 - IANA Guidelines for ARP
  • RFC 5970 - September 2010 - DHCPv6 Options for Network Boot