Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Booting Ghost from a Linux PXE Server

Updated: 10 Dec 2009 | 6 comments
Lohizune's picture
+4 4 Votes
Login to vote

 Review the steps in the doc file enclosed to the article. The solution has been implemented on a Fedora Server edition but it can also be implemented on other server distributions.

Review the following steps in this article. The solution has been implemented on a Fedora Server edition but it can also be implemented on other server distributions

1. Installing and configuring the DHCP server

  • Get the latest dhcp package from your distribution sources.
  • Make sure you network adapter is set to static ip address
  • To make sure your dhcp server is listening on the desired interface edit the file /etc/sysconfig/dhcp and set you interface as dhcpdargs such as dhcpdargs=eth0
  • To configure your dhcp server edit the file /etc/dhcp.conf such as below
    #########                          DHCP CONFIGURATION          ##########
    ddns-update-style none;
    ignore client-updates;
    authoritative;
    
    subnet 10.0.0.0 netmask 255.0.0.0 {
    
                        option routers 10.0.0.1;
                        option subnet-mask 255.0.0.0;
                        option domain-name "domain.com";
                        option domain-name-servers 10.0.0.2;
                 
               range 10.0.0.3 10.0.0.30;
    
                          option broadcast-address 10.255.255.255;
                          default-lease-time 86400;
                          max-lease-time 604800;
                          next-server 10.0.0.3;   (tftp server address);
                          filename "pxelinux.0";  (Linux bootstrap file)
    
    }
    
    
    #END
    
  • To start the dhcp server open a terminal and type "service dhcpd start" or "/etc/init.d/dhcpd start eth0 -cf /etc/dhcp.conf"

2. Installing and configuring the TFTP server

  • Get the latest tftp package from your distribution sources.
  • /tftpboot is the default tftp root folder and will store all the boot files claimed by the pxe clients
  • Create a file called 'remap' in /etc
  • Edit /etc/remap as below
    rg \\ /
    

Note:
The remap file aims at remapping windows shell to Linux shell ie: if a client claims for the file winpe.wim located in the boot folder it will request it using the following path \boot\winpe.wim and because the tftp server is expecting the file in /boot/winpe.wim instead, a tftp error will pop up saying that the file does not exist. The remap file is simply remapping the request from \boot to /boot). Remapping the shell is only necessary when booting  windows clients.

  • Configure the tftp daemon in /etc/xinetd.d/tftp

Note:
In our example the tftp server is launched by the superdaemon xinetd but can also run in standalone mode)

  • - Edit /etc/xinetd.d/tftp as below:
    {       
    
                  disable = no
                  socket_type                     = dgram
                  protocol                           = udp
                  wait                                  = yes
                  user                                  = root
                  server                               = /usr/sbin/in.tftpd
                  server_args                      =  -s -v -m /etc/remap /tftpboot
                  per_source                       = 11
                  cps                                   =  100 2
                  flags                     
    

If the tftp daemon is set to start with xinetd or inetd just run the following command:

service xinetd start

To make sure the daemon is listening on port 69 run the following command:

netstat -an| grep 69

To stop the daemon run:

service xinetd stop

If the tftp daemon is no set to start with the super daemon it has to be started manually (standalone mode) as with the following command:

/usr/sbin/in.tftpd -l -v -m /etc/remap

To stop it you have to locate the PID with the following command:

ps -ef| grep in.tftp

Then kill the process with the command:

kill -9 PID

Note:
All clients' requests are logged into /var/log/messages. This can vary from the distribution used.

It can help troubleshooting any tftp communication issues.

3. Setting the tftp folder content

By default the root of the tftp boot folder is /tftpboot but you can change it to another location and declare it in /etc/xinetd.d/tftp as below

In any pxe installation you need a bootstrap file that is the first boot file downloaded by the pxe client. With Linux the bootstrap file is called pxeboot.0.

The bootstrap file needs to read a configuration file called 'default' and must be located in the /tftpboot/pxelinux.cfg folder. The default file is basically your pxe menu with entries that point to the corresponding boot image file

The bootstrap file and the configuration file are part of the package syslinux that you can download from anywhere on Internet.

The default configuration file should look like below:

##########                             PXE CONFIGURATION FILE         #######################

# Displays the menu

default vesamenu.c32 (can be found anywhere on the internet)

# Prompt user for selection

prompt 0

# Automatic boot to the first option after a timeout

timeout 600


# Entry to each boot image

Label local
           localboot

In the basic configuration file we can only boot locally.

The next step is to setup the Linux thin client, winpe with ghost32 and pcdos with the older version ghost 16 bits so the pxe clients can run from the three environments.

a) Setting up the Linux thin client

  • Open the ghost boot wizard, select Linux and select TCP/IP Network Boot image
  • Copy the file ghost.zip to the root of the tftp folder
  • Create a folder called Linux in your tftproot folder and copy the following files into it:
    • initrd
    • vmlinuz
  • Edit the file /tftp/pxelinux.cfg/default and add the following line:
        Label Linux Thin Client
                kernel linux/vmlinuz
                append ramdisk_blocksize=4096 initrd=linux/initrd root=/dev/ram0 ramdisk_size=524288 console=ttys3 acpi=off
    

b) Setting up the PCDos ghost client

  • Open the ghost boot wizard, select pcdos or msdos (download the msdos file from http://www.bootdisk.com/bootdisk.htm) and create a 3com boot image file
  • Use the 3com tools to extract the content of the boot image
  • Use winimage (www.winimage.com) or any other tools to create a boot image with the extracted file and save the image as img or imz
  • Get memdisk from the syslinux package: memdisk simulates a disk by claiming a chunk of high memory for the disk and a ( very small -2k typical) chunk of low (DOS) memory for the driver itself, then hooking the INT 13h (disk driver) and INT 15h (memory query) BIOS interrupts.
  • Create a folder called ghostdos in the tftpboot folder
  • Copy the boot image file and memdisk to the ghostdos folder

Eventually, modify the pxe configuration file as below:

Label Ghotsdos
          kernel ghostdos/memdisk
          append initrd=ghostdos/pcdos.imz

c) Setting up winpe ghost client

  • Open the ghost boot wizard, select winpe and create a TCP/IP network boot image
  • From the boot folder just created copy the pxeboot.n12 bootstrap file and the bootmgr.exe to the /tftpboot folder
  • Rename the bootstrap file pxeboot.n12 into pxeboot.0 to be compatible with the Linux tftp server requirements
  • Create a folder called winpe into the tftpboot folder and copy the following files: bcd, boot.sdi, winpe.wim
  • Rename the bcd file into BCD as linux shell is case sensitive (mv bcd BCD)
  • Create symbolic links 'boot' and 'Boot' that point to winpe as windows clients are claiming for files in 'boot' and 'Boot'

Commands from the tftpboot folder:

ln -s winpe/ boot
ln -s winpe/ Boot

Eventually, modify the pxe configuration file as below:

Label Winpe
          kernel pxeboot.0

If you get the vesamenu.c32, the splah.jpg image and all the .msg files from any of you favorite distribution from the internet and pxeboot one client you get the following result:

Here is the pxe default configuration file

########################## PXE TABLE #########################
default vesamenu.c32 
timeout 600
prompt 0

menu background splash.jpg
menu title  Welcome to Symantux Ghost!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000



LABEL local 
      localboot


LABEL Winpe
    kernel pxeboot.0

LABEL Linux Thin Client
    kernel gssl/vmlinuz
    append ramdisk_blocksize=4096 initrd=gssl/initrd root=/dev/ram0 ramdisk_size=524288 console=ttyS3 acpi=off
    ipappend 1

LABEL Ghost PCDos
     kernel ghostdos/memdisk
     append initrd=ghostdos/pcdos.imz

This configuration has been implemented on a fedora 7 system, Kernel 2.6.21.3194.fc7, dhcp-3.0.5.5-42.fc7, tftp-server-0.42-4. Ghost version 11.5

Comments

Beach_HVAC's picture
20
Jan
2010
0 Votes 0
Login to vote

Will this work with Red Hat

Will this work with Red Hat 9?

Lohizune's picture
29
Jul
2010
0 Votes 0
Login to vote

Sorry for the late reply. There is no reason why it should not work as the process are the same. for delivering the pxe files. You might have a more up to date dhcp, tftp or syslinux files but the process remains the same. I have tested it on red hat 2 5 an 6 already.

Cheers

thanhthao1510@gmail.com's picture
26
Apr
2011
0 Votes 0
Login to vote

hi, please answer the

hi, please answer the question:

remap is the file. why have it the path /etc/remap/tftpboot ???

Lohizune's picture
07
Jul
2011
0 Votes 0
Login to vote

Hello,    Sorry i do  not

Hello, 

 

Sorry i do  not understand the question!!

 

 

cheers

securekumar's picture
12
Dec
2011
0 Votes 0
Login to vote

Can i use it for Linux to Windows Ghost

I plan to setup it for Linux (server) to windows (client) Ghost.

 

Is it working ?

Lohizune's picture
13
Dec
2011
0 Votes 0
Login to vote

Of course.

Of course.