PXE Server Installation

From ProjectDiaStar

Jump to: navigation, search

Warning - Still under construction!!

Contents

PXE Server Setup

A permanent system should be selected for the PXE (Pre-Execution Environment) server. On server system, a TFTP boot server, DHCP server and Apache web server are needed. If they do not already exist, they may be installed with:

# yum install tftp-server
# yum install dhcp
# yum groupinstall "Web Server"

Follow the basic PXE configuration instructions for CentOS that are found here. Configuration files used with the DiaStar ISO are found below. Substitute your IP addresses as needed.

DHCP Sample Configuration File

This file is located here - /etc/dhcpd.conf.

#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
allow booting;
allow bootp;
ddns-update-style ad-hoc;
subnet 192.168.1.0 netmask 255.255.255.0 {
       range 192.168.1.30 192.168.1.49;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.1.255;
       option routers 192.168.1.1;
       option domain-name-servers 151.203.0.84;
       filename "pxelinux.0";
       next-server 192.168.1.119;
}

Default PXE Menu File

This file is located here - /tftpboot/pxelinux.cfg/default.

default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE PXE Menu for DiaStar ISO Installation

LABEL Latest DiaStar ISO Install
       MENU LABEL Latest DiaStar ISO Install
       KERNEL images/diastar/vmlinuz
       APPEND initrd=images/diastar/initrd.img ramdisk_size=8192 ksdevice=eth0
              ks=http://192.168.1.119/diastar/ks.cfg

Obtaining and Mounting the DiaStar ISO image

Download the desired DiaStar ISO file from the projectdiastar.org website. Mount the DiaStar ISO file with:

# mkdir -p /mnt/cdrom
# mount -o loop -t iso9660 <diastar_file_name>.iso /mnt/cdrom

Copy the files from /mnt/cdrom into /var/www/html/diastar:

# mkdir /var/www/html/diastar
# cp -r /mnt/cdrom/* /var/www/html/diastar

Copy linux boot images into tftp boot server directory:

# cp /var/www/html/diastar/isolinux/vmlunuz /tftpboot/images
# cp /var/www/html/diastar/isolinux/initrd.img /tftpboot/images

Special ks.cfg - We need to have a 2nd ks.cfg file in the ISO that doesn't used a CDROM.

gPXE Boot Disc

While some versions of BIOS contain the PXE code needed to boot from a TFTP server, many do not. The workaround for this is to boot the system on which the installation is to be done from a gPXE boot disk that then downloads the needed files from the TFTP boot server. Making and downloading this disk is simple. Instructions can be found here.

Running the Installation

On the Server

  • The TFTP boot is automatically started, but the DHCP and Apache Web servers must be manually started: (chkconfig --add ?? )
# service dhcpd start
# service httpd start

Make sure the right ks.cfg file is used - need to edit the ks.cfg to do "wget" Use ks.cfg in html dir for example

On the Target

  • Boot the target system from the gPXE boot disc. It should automatically find the TFTP boot server
  • The PXE server menu has a single choice - Latest DiaStar ISO Install. Hit CR to choose
  • Other choices appear as part of the CentOS install:
    • Installation method - choose HTTP
    • HTTP Setup - enter the web/PXE server IP address and CentOS dir name - diastar
    • There may be a query for configuring 2nd ethernet interface (if one exists)
    • There will be a choice on entering the system's hostname
  • When done, remove the gPXE boot disk and reboot.
Personal tools