Linux KickStart – Automated Installation

What Is KickStart Installation?

Kickstart installations offer a means to automate the installation process, either partially or fully. Kickstart files contain answers to all questions normally asked by the installation program, such as what time zone you want the system to use, how the drives should be partitioned, or which packages should be installed. Providing a prepared Kickstart file when the installation begins therefore allows you to perform the installation automatically, without need for any intervention from the user. This is especially useful when deploying Red Hat Enterprise Linux on a large number of systems at once.
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 Linux on multiple machines, making it ideal for network and system administrators.
All Kickstart scripts and the log files of their execution are stored in the /tmp directory to assist with debugging installation failures.
 

Note

You must read your distribution documents about fresh installation and upgrading current OS because some distributions don’t support upgrading via KickStart.

How Do You 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:
  1. Create a Kickstart file.
  2. Make the Kickstart file available on removable media, a hard drive or a network location.
  3. Create boot media, which will be used to begin the installation.
  4. Make the installation source available.
  5. Start the Kickstart installation.

Creating a Kickstart File

The Kickstart file itself is a plain text file which serve as directions for the installation. Any text editor able to save files as ASCII text, such as Gedit or vim on Linux systems or Notepad on Windows systems, can be used to create and edit Kickstart files. The file name of your Kickstart configuration does not matter; however, it is recommended to use a simple name as you will need to specify this name later in other configuration files or dialogs.
The recommended approach to creating Kickstart files is to perform a manual installation on one system first. After the installation completes, all choices made during the installation are saved into a file named anaconda-ks.cfg, located in the /root/ directory on the installed system. You can then copy this file, make any changes you need, and use the resulting configuration file in further installations.
If you have a Red Hat Customer Portal account, you can use the Kickstart Configuration Tool available at https://access.redhat.com/labs/kickstartconfig/ in the Access Labs. This tool will walk you through basic configuration and allows you to download the resulting Kickstart file. However, the tool currently does not supported any advanced partitioning.
You can read RedHat documents about KickStart file structure, its sections and its keywords to write advanced KickStart file.

 

KickStart Example

Here is an example for KickStart configuration file:

The KickStart file has been copied from an exist Linux and I have customized that for other machines.

The file should be named as “ks.cfg”. It’s usual name for KickStart configuration file.

You can remove “#” from second line and active “Interactive” mode that means, administrator can override KickStart configuration, this mode is disabled by default.

If you face with “Storage Device Warning” then you should add “zerombr yes” in your configuration file.

Prepare Local Installation Media

After preparing KickStart configuration file, you need to create a boot media or prepare PXE for booting servers. I want to show you process of preparing boot and installation ISO on a single DVD.

I have used Oracle 6.8 ISO for that and you can use this instruction for RedHat Enterprise Linux and any other distributions that those are based on RHEL.

At first step, you need to a exist Linux and mount ISO on it and then follow the instruction:

  1. Mount the ISO file to a folder such as /mnt
  2. Make a folder for source files: /iso
  3. Copy all files and folders to /iso:
    It takes some minutes because more than 3GB should be copied.
  4. Two hidden files won’t copy by the above command, so copy the files manually:
  5. Then copy “ks.cfg” (KickStart configuration file) to “/iso/isolinux”
  6. Now, menu should be configure, so edit “/iso/isolinux/isolinux.cfg” and add the below lines to that:
    Add them top of first “label” keyword. We are going to create an installation DVD for KickStart installation and normal installation, so don’t touch rest of menu sections. If you are using RHEL 7, use “inst.ks” instead of “ks” and also if you want to boot your machine by USB or hard disk, you should replace “cdrom” with “hd:LABEL”. Read “Boot Options” on RHEL document library or “Anaconda” document or “Oracle KickStart Boot Options” for more information.
  7. Now, you need to make ISO file from /iso directory:
    Make sure that ISO label is same as label that you have added to “isolinux.cfg” in previous steps.
  8. After the ISO file has been created completely, ISO checksum should be calculated:
    If you don’t have access to the command above, make sure the “genisoimage” and “isomd5sum” RPMs have been installed on your system.
  9. Burn the ISO file and check it.

KickStart Menu

Please share with me, if you face with any error or issue.

If you want to have advanced configurations or find more details about configuration that i have used, please read your distribution vendor documents. You will find very useful information.

Davoud Teimouri

Davoud Teimouri is as a professional blogger, vExpert 2015/2016/2017/2018, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Leave a Reply

Your email address will not be published. Required fields are marked *