Skip to main content

Setup Kickstart Server in Linux ( RHEL/CENTOS)


What is Kickstart?

Many system administrators would prefer to use an automated installation method to install Red Hat Enterprise Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical installation.
Kickstart files can be kept on a single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.
Kickstart provides a way for users to automate a Red Hat Enterprise Linux installation.
All kickstart scriptlets and the log files of their execution are stored in the /tmp directory to assist with debugging installation failures.

How to perform a Kickstart Installation?
Kickstart installations can be performed using a local DVD, a local hard drive, or via NFS, FTP, HTTP, or HTTPS.
To use kickstart, you must:
·         Create a kickstart file.
·         Create a boot media with the kickstart file or make the kickstart file available on the network.
·         Make the installation tree available.
·         Start the kickstart installation.

To create a kickstart file, you can use Kickstart Configurator.
Kickstart Configurator is not installed by default on Red Hat Enterprise Linux 6. Run su - yum install system-config-kickstart or use your graphical package manager to install the software.

Setup Kickstart Server in Linux

1.    Install tftp server and enable TFTP service
a.     yum install tftp-server.
b.    Enable TFTP server.
vi /etc/xinetd.d/tftp and change disable to 'no'
c.     service xinetd restart

2.    Install syslinux if not already installed
yum install syslinux

3.    Copy needed files from syslinux to the tftpboot directory
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
cp /usr/lib/syslinux/menu.c32 /tftpboot
cp /usr/lib/syslinux/memdisk /tftpboot
cp /usr/lib/syslinux/mboot.c32 /tftpboot
cp /usr/lib/syslinux/chain.c32 /tftpboot

4.    Create the directory for your PXE menus
mkdir /tftpboot/pxelinux.cfg

5.    For each "Release" and "ARCH" Copy vmlinuz and initrd.img from /images/pxeboot/ directory on "disc 1" of that $Release/$ARCH to /tftpboot/images/RHEL/$ARCH/$RELEASE
mkdir -p /tftpboot/images/RHEL/i386/5.
mkdir -p /tftpboot/images/RHEL/i386/5.8
mkdir -p /tftpboot/images/RHEL/x86_64/5.1
mkdir -p /tftpboot/images/RHEL/x86_64/5.8

6.    For RHEL 5.8 x86_64, do the following
mount /dev/cdrom /cdrom
cd /cdrom/images/pxeboot
cp vmlinuz initrd.img /tftpboot/images/RHEL/x86_64/5.8
Do the above for all releases and ARCH you want to kickstart from this server.

7.    Add this to your existing or new /etc/dhcpd.conf.

8.    Note: xxx.xxx.xxx.xxx is the IP address of your PXE server
allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server xxx.xxx.xxx.xxx;
filename "/pxelinux.0";

9.    Restart DHCP service
  service dhcpd restart

10.  Create Simple or Multilevel PIXIE menu. Create a file called "default" in /tftpboot/pxelinux.cfg directory. A Sample file named "isolinux.cfg" is found on the boot installation media in "isolinux" directory. Copy this file as default and edit this file as per requirement. A sample default file is given bellow.
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE PXE Menu

LABEL Pmajic
        MENU LABEL Pmajic
        kernel images/pmagic/bzImage
        append noapic initrd=images/pmagic/initrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=100000

label Dos Bootdisk
        MENU LABEL ^Dos bootdisk
        kernel memdisk
        append initrd=images/622c.img

LABEL RHEL 5 x86 eth0
        MENU LABEL RHEL 5 x86 eth0
        KERNEL images/RHEL/x86/5.8/vmlinuz
        APPEND initrd=images/RHEL/x86_64/5.8/initrd.img ramdisk_size=10000
               ks=nfs:xx.xx.xx.xxx:/ ksdevice=eth1

LABEL RHEL 5 x86_64  eth0
        MENU LABEL RHEL 5 x86_64  eth0
        KERNEL images/RHEL/x86_64/5.8/vmlinuz
        APPEND initrd=images/RHEL/x86_64/5.8/initrd.img ramdisk_size=10000
               ks=nfs:xx.xx.xx.xxx:/ ksdevice=eth1

11.  Install the kickstart Configurator tool. This tool will be helpful to create the kickstart configuration file.
yum install system-config-kickstart

12.  Create the kickstart config file. This file can be created using kickstart Configuration Tool. A Sample file anaconda-ks.cfg based on current installation of a system is placed in /root directory. We can also use this /root/anaconda-ks-cfg as the configuration file. Copy this file to the location specified in the default file. Make sure the directory is NFS exported if you are using NFS for installing the OS.

13.  Modify the kickstart configuration file as per requirement. If you are using NFS for installation, Make sure to copy the ISO images of Linux disks to any NFS server and NFS export the directory. This server/directory details need to be specified in the jumpstart configuration file.

14.  After creating the KS configuration files and copying the ISO images, the installation can be started.


Comments

Popular posts from this blog

Virtual Box and Alt/Tab Keys

I use virtual box for all my testing activities. It comes too often that I have a virtual box VM window open & I want to switch to my host machine to see some stuff like tutorials etc.. If you press the alt+tab combination it just works inside the VM & doesn't switches to host machine. In these scenarios you can press the host key once ( not hold it ) & then whatever you press goes to host machine. So in general where host key is the default Right Ctrl, just press Right Ctrl once & now press the alt+tab & it will switch you out to host machine. This is really helpful when you have the VM windows open or you're working on seamless mode. Hope it help others too.

CentOS / Redhat : Configure CentOS as a Software Router with two interfaces

Linux can be easily configured to share an internet connection using iptables. All you need to have is, two network interface cards as follows: a) Your internal (LAN) network connected via eth0 with static ip address 192.168.0.1 b) Your external WAN) network is connected via eth1 with static ip address 10.10.10.1  ( public IP provided by ISP ) Please note that interface eth1 may have public IP address or IP assigned by ISP. eth1 may be connected to a dedicated DSL / ADSL / WAN / Cable router: Step # 1: Enable Packet Forwarding Login as the root user. Open /etc/sysctl.conf file # vi /etc/sysctl.conf Add the following line to enable packet forwarding for IPv4: net.ipv4.conf.default.forwarding=1 Save and close the file. Restart networking: # service network restart Step # 2: Enable IP masquerading In Linux networking, Network Address Translation (NAT) or Network Masquerading (IP Masquerading) is a technique of transce...

AMD Radeon™ HD 7670M on Ubuntu 12.04

Update:   Recently I install kubuntu 13.10 and there is no problem with graphics. It just works  fine out of the box. I've seen many blog posts on how to make AMD HD7670M work on Ubuntu 12.04, specially when its in switchable graphics board like Dell Inspiron 15R 5520. I tried many things to make it work so that I could use the cinnamon desktop on ubuntu & other things too.. But to my surprise even the drivers from AMD site didn't work. Then I tried a combination of those blog posts I read & somehow I became successful in running the full graphics including compiz settings inside My Ubuntu Machine. Following are the steps I followed & it worked... 1. Create a backup of your xorg configuration file: sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.BAK 2. Remove/purge current fglrx and fglrx-amdcccle : sudo apt-get remove --purge fglrx* 3. Install the driver: sudo apt-get install fglrx fglrx-amdcccle 4. Install additiona...