SuSE install with PXE boot
From openSUSE
Contents |
Introduction
Since the SUSE Linux distribution is very up to date, it changes often. Thus, it could be pleasant to install systems without burning new CDs or DVDs for each installation. So here is the best way to install SuSE fully from network.
PXE is way to start computers without Floppy/Hard Disk/CD-ROM, that is, the BIOS will start right from the network using the PXE protocol. Of course, 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). Few OSes support PXE Server configuration - but Windows 2000 Server & SUSE Linux do.
Getting ready
For a successful networked install, you should have:
- an existing SuSE Linux (hosting dhcpd and tftpd),
- an internet connection (broadband highly recommended),
- a networked target system supporting PXE boot.
Configuring dhcpd & TFTP server
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 SuSE distribution since 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 "/tftpboot/pxelinux.0";
}
Notice that 2 lines are added specialy 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 wether 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 desireable 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 ingore 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/atftp. Here is the typical configuration:
ATFTPD_OPTIONS="--daemon --user tftp -v" ATFTPD_USE_INETD="no" ATFTPD_DIRECTORY="/srv/tftp"
In this example, note that the tftp root directory is set to /srv/tftp. 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. And 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 unprivilegued user are to be made on behalf xinetd (that is, /etc/xinetd.d/tftp).
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 usefull 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. Jump in the TFTP root directory (default is /srv/tftp) and create the initial structure as shown below:
# cd /srv/tftp # mkdir tftpboot # cd tftpboot # mkdir pxelinux.cfg
Copy PXE bootstrap file in tftpboot directory.
# cp /usr/share/syslinux/pxelinux.0 /srv/tftp/tftpboot
Create now the PXE config file. This one is not far in its structure from the syslinux.cfg file.
# vi /srv/tftp/tftpboot/pxelinux.cfg/default
Here is a sample one provided as is, feel free to adapt it to fit your configuration.
default linux prompt 1 timeout 30 # Install Linux label linux kernel linux append initrd=initrd splash=silent showopts
Please Note: If you are using a RedHat based server, your default configuration will need a few more options for the line begining 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 SuSE install repository (or a mirror). Notice they depend on your hardware (i386 or x86_64).
- eg. for i386:
# cd /srv/tftp/tftpboot # wget http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/boot/i386/loader/initrd # wget http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/boot/i386/loader/linux
- eg. for x86_64:
# cd /srv/tftp/tftpboot # wget http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/boot/x86_64/loader/initrd # wget http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/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
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!
Gotchas / 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 do a hostname, as is shown in the examples, you can have just a line like this:
next-server 192.168.77.254;
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 install system has finished loading drivers you will be presented with a message saying that the openSUSE Install CD could not be found. Hit OK. You will then be asked to select your language and keyboard map.
Once at the Main Menu, select "Start Installation or System", then "Start Instillation or Update". Next choose Network as the source medium to install from. You now need to locate an internet instillation repository to install from. Select an appropriate mirror from Mirrors Released Version. I chose:
ftp://ftp.mirrorservice.org/sites/ftp.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/
Now select FTP or HTTP depending on the type of mirror you chose. Now choose the appropriate network device, and use DHCP. You will next be asked for the IP address of the server. Despite the request for an IP address, a hostname works fine, eg:
ftp.mirrorservice.org
Next you will be asked to enter the directory on the server, eg:
/sites/ftp.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/
The graphical instillation system will then be downloaded from your mirror. You may be told "Installation system does not match your boot medium.". Ignore this and continue. After a short pause the full graphical YaST should be loaded. You can now proceed with the instillation as normal.
Troubleshooting
Text based YaST Loads Instead of X Server
If your computer is not too low spec to use the GUI installer you may be able to get the X Server to start by manually specify a resolution and colour depth to use. I found this to be the case with my Latitude C400 laptop. To do this, go back to your TFTP server and edit the pxelinux.cfg/default file. On the line:
append initrd=initrd splash=silent showopts
add the following:
vga=xxx
where xxx is a Linux video mode number for a mode you know your monitor/graphics card works with. eg:
append initrd=initrd splash=silent showopts vga=773
You can find a list of Linux video mode numbers here. Boot with PXE again and the X Server should start properly.

