Home Wiki > SDB:PXE boot installation
Sign up | Login

SDB:PXE boot installation

tagline: From openSUSE

This article covers the procedures of a network installation using Preboot eXecution Environment (PXE).

Introduction

Preboot eXecution Environment (PXE) is way to start computers without Floppy/Hard Disk/CD-ROM with the BIOS starting directly from the network using the PXE protocol. In order for PXE to work, the server needs OS configuration, and the client side needs a code module that runs PXE for the given LAN card (NIC). Most newer mainboards that have an on-board LAN port already have the module as part of their BIOS image. If you want to boot from a daughterboard NIC, i.e. a card in a ISA/PCI/etc. slot, you need to put the proper module either on a BootROM (only applicable when the NIC has a ROM socket), or into the BIOS image (only applicable when there is a proper image tool available, AMIFLASH is one).


Getting ready

For a successful networked install, you should have:

  • an existing openSUSE (hosting dhcpd and tftpd - install with zypper in atftp dhcp-server ),
  • an internet connection (broadband highly recommended),
  • a networked target system supporting PXE boot.

Configuration

dhcpd config

PXE boot is based on a BOOTP server which will send all the essential information for the system to start its network layer. That job could be done with the well known DHCPd server included in the openSUSE distribution if you set up a static configuration. Here is the typical configuration (default configuration file is /etc/dhcpd.conf):

host target_host {
     hardware ethernet xx:xx:xx:yy:yy:yy;
     fixed-address 192.168.1.10;
     server-name "192.168.1.1";
     next-server 192.168.1.1;
     filename "pxelinux.0";
}

Notice that 2 lines are added specially for the PXE boot. Indeed it is necessary to specify the TFTP boot server IP (server-name) and the filename containing PXE bootstrap (filename).

You need to (re)start the DHCPd server as follows:

 # rcdhcpd restart

Please Note: Depending on which tftp server you use and whether it runs in a chroot environment the "filename" may have to be specified without a leading path element. For the standard tftpd server on openSUSE or if you are using a RedHat based server, the "filename" should read:

filename "pxelinux.0";

With the ISC DHCP server version 3 (shipped on openSUSE) it is possible to configure the DHCP server to only respond to booting requests and this way run it in parallel with another default dhcp server. This may be desirable in case the default dhcp server can not be configured to supply a boot server or boot file name (this is the case with many DSL routers). The PXE client will ignore DHCP offers that do not contain a boot server or boot file name. Below is a complete configuration file for this scenario:

default-lease-time 600;
max-lease-time 7200;
ddns-update-style none; ddns-updates off;
allow booting;
 
option domain-name "my.domain";
option domain-name-servers my.dnsserver;
option routers my.router;
   
# define rules to identify DHCP Requests from PXE and Etherboot clients.
class "pxe" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
}
class "etherboot" {
    match if substring (option vendor-class-identifier, 0, 9) = "Etherboot";
}
   
subnet 192.168.1.0 netmask 255.255.255.0 {
    option broadcast-address 192.168.1.255;
    pool {
         default-lease-time 180; # no long lease time required for booting
         max-lease-time 360;     # booted system does its own dhcp request
         server-name "mybootserver";
         next-server mybootserver.; # in case your local DNS only handles
                                    # unqualified domains keep trailing '.'
         filename "pxelinux.0";
         allow members of "pxe";
         allow members of "etherboot"; # allow etherboot, too
         range 192.168.1.201 192.168.1.211;
     }
}

atftpd config

It is recommended to use atftp package because atftp is the only free TFTP server complying with all RFC. Once installed, you should check that everything is OK in /etc/sysconfig/atftpd. Make sure you have tftp as a user on your system, otherwise you will have an error on restarting the daemon and it will fail to load. Here is the typical configuration:

ATFTPD_OPTIONS="--daemon --user tftp -v"
ATFTPD_USE_INETD="no"
ATFTPD_DIRECTORY="/srv/tftp/tftpboot"

In this example, note that the tftp root directory is set to /srv/tftp/tftpboot. You need to (re)start the TFTP server as follows:

 # rcatftpd restart

Please Note: The default tftp server that accompanies RedHat Enterprise Linux will do just fine. It will not require any further configuration. Simply start the service using the following command.

chkconfig tftp on

tftpd-hpa config

tftpd-hpa is the tftpd server from H. Peter Anvin, available in the "tftpd" package. In its default setup, it is configured to be started from xinetd and will chroot to the directory specified in /etc/xinetd.d/tftp, usually /tftpboot. Options to run as unprivileged user are to be added in /etc/xinetd.d/tftp as well.


Setting up PXE boot environment

Getting all

Before really starting to build the PXE environment, you have to install the syslinux package. This package provides a very useful file:

 /usr/share/syslinux/pxelinux.0

If you can not install syslinux, you can download this little file here.

Building PXE boot

At that point, you should have everything to build your PXE boot environment. Create the initial directory structure under the TFTP root directory as shown below:

 # mkdir -p /srv/tftp/tftpboot/pxelinux.cfg

Copy PXE bootstrap file into tftpboot directory.

 # cp /usr/share/syslinux/pxelinux.0 /srv/tftp/tftpboot

Create the PXE config file by editing /srv/tftp/tftpboot/pxelinux.cfg/default. This is almost the same as the syslinux.cfg file. Here is a sample PXE config file:

default install
prompt   1
timeout  30
  
# Install i386 Linux
label install
  kernel linux
  append initrd=initrd splash=silent vga=0x314 showopts install=http://download.opensuse.org/factory/repo/oss/

# Install x86_64 Linux
label install64
  kernel linux64
  append initrd=initrd64 splash=silent vga=0x314 showopts install=http://download.opensuse.org/factory/repo/oss/ 

Copy the kernel and initrd (here: linux, initrd, linux64, initrd64) to /srv/tftp/tftpboot.

Please Note: If you are using a RedHat based server, your default configuration will need a few more options for the line beginning with "append":

append root=/dev/ram0 load_ramdisk=1 initrd=initrd splash=silent showopts ramdisk_size=4096 init=linuxrc

This configuration file refers to 2 important files: linux and initrd. They have to be downloaded from the network openSUSE install repository (or a mirror). Notice they depend on your hardware (i386 or x86_64).

# cd /srv/tftp/tftpboot
# wget http://download.opensuse.org/factory/repo/oss/boot/i386/loader/linux
# wget http://download.opensuse.org/factory/repo/oss/boot/i386/loader/initrd
# wget -O initrd64 http://download.opensuse.org/factory/repo/oss/boot/x86_64/loader/initrd
# wget -O linux64 http://download.opensuse.org/factory/repo/oss/boot/x86_64/loader/linux

Please Note: If you are using a RedHat based server, your directory structure for the tftp-server should be as follows:

 /tftpboot 
 /tftpboot/pxelinux.0 
 /tftpboot/initrd.img 
 /tftpboot/vmlinuz 
 /tftpboot/pxelinux.cfg 
 /tftpboot/pxelinux.cfg/default

Using this config, you can type either "install" or "install64" at the boot: prompt.

You may also create a boot message file the same as what syslinux and isolinux uses, to display the available boot: prompt options. To do that edit /srv/tftp/tftpboot/f1.txt and add:

boot options:
  install   - install 32 bit i386 openSUSE 10.3
  install64 - install 64 bit x86_64 openSUSE 10.3

Then edit /srv/tftp/tftpboot/pxelinux.cfg/default and add near the top:

 DISPLAY f1.txt
 F1 f1.txt

Now when booting, instead of just a boot: prompt, you would see:

boot options:
  install   - install 32 bit i386 openSUSE 10.3
  install64 - install 64 bit x86_64 openSUSE 10.3
 
boot:

Booting PXE

You should ensure that your target host is well configured to boot from network and check that PXE is enabled. Then everything will run as accordingly... enjoy PXE & have a lot of fun!


Common issues

PXELINUX boot is very slow

You may find that while PXELINUX loads, it then seems to take a really long time going through all the different lines like:

 pxelinux.cfg/01-88-99-aa-bb-cc-dd
 pxelinux.cfg/C000025B
 pxelinux.cfg/C000025
 pxelinux.cfg/C00002
 pxelinux.cfg/C0000
 pxelinux.cfg/C000
 pxelinux.cfg/C00
 pxelinux.cfg/C0
 pxelinux.cfg/C
 pxelinux.cfg/default

You have to make sure that you have next-server in your /etc/dhcpd.conf file set to the address of your tftp server. You don't have to use a hostname, as is shown in the examples, you can have just a line like this:

 next-server 192.168.77.254;

Alternately, if you have a router set to assign IP addresses for your network, use the routers IP for the next-server. ie:

 next-server 192.168.0.1

No options accepted

You might also get warning messages like the following in /var/log/messages:

in.tftpd: tftp: client does not accept options

This is normal. PXELINUX does not seem to accept all options, but it does not impact booting.

Socket errors when running in.tftpd

If you get errors like:

in.tftpd: cannot bind to local socket: Address already in use

Then you might have mis-configured the options for the server in /etc/xinet.d/tftp. Check those options carefully.


Starting the Graphical Install System

After the PXE loaded, it will load and start the graphical install system, which is same as the normal one. Continue installing as usual.

Troubleshooting

does not start the Graphical Install System

If your network environment has no DHCP server or misconfigured DHCP server, Please make sure your installation medium is available message is shown instead of graphical install system. If you faced such problem, follow this procedure:

  1. Select No for Please make sure your installation medium is available. Retry? message (TAB or cursor key to move cursor, enter key to select)
  2. Select your language for Select the language (note that it's scrollable; push down cursor key repeatedly)
  3. Select your keyboard map for Choose a keyboard map.
  4. Select Start Installation for Main Menu.
  5. Select Installation for Start Installation.
  6. Select Network for Choose the source medium.
  7. Select one of protocols for Choose the network protocol. If you want to use the official site of openSUSE, select HTTP.
  8. Select No for Automatic configuration via DHCP?.
  9. Enter an IP address and subnet mask for Enter your IP address with network prefix.; note that the subnet mask must be specified by CIDR style (i.e. "24" instead of "255.255.255.0").
  10. Enter a default gateway address for Enter your gateway IP address.. If you do not have one, leave empty.
  11. Enter a name (DNS) server address for Enter your name server IP address.. If you do not have one, leave empty.
  12. Enter a domain name for Enter your search domains. If you do not have one, leave empty.
  13. Enter a download site for Enter the name of the xxx server. If you want to use the official site of openSUSE, set download.opensuse.org (default).
  14. Enter a directory path in download site for Enter the directory on the server. Set distribution/(version)/repo/oss/ for official site of openSUSE.
  15. Select one for Do you need a username and password to access the xxx server?. Set No for official site of openSUSE.
    1. If you selected Yes for above, enter the username and password for Enter the user name.. and Enter the password...
  16. Select one for Use a xxx proxy?, according to your network environment.
    1. If you selected Yes, enter the proxy server address and port for Enter the name of the xxx proxy and Enter the port of the xxx proxy.
    2. Select one for Do you need a username and password to access the proxy?, according to your network environment.
      1. If you selected Yes for above, enter the username and password for Enter the user name.. and Enter the password...

If you finished it, Loading Installation System message will be shown and will start graphical installation.

Corrupted graphics or Text based YaST Loads Instead of X Server

Change the vga= value on the append line in /srv/tftp/tftpboot/pxelinux.cfg/default (values can be selected from VESA BIOS Extensions). If you specify the value by hex, it should be started with 0x. If you specify the value by decimal, set as-is (including values described earlier).


See also


External links