Business News Daily receives compensation from some of the companies listed on this page. Advertising Disclosure


Automating Linux Installation with Kickstart

By Business News Daily Staff

What is Kickstart?

Installing Red Hat based systems from physical or virtual media is easy enough when there is only one or two hosts to install. Beyond this, when an administrator needs to setup several Linux systems, Kickstart can provide a relatively easy way to accomplish mass deployment and can be totally automated. It is easy to have several different Kickstart configurations ready to go, each having a different deployment configuration.

Most large companies use this technique to deploy a Red Hat base server image that can then be customized as required. What makes Kickstart even easier is that an administrator can configure Kickstart with nothing more complex than a web server, installation media and at least one Kickstart configuration file. The only other requirement is an active DHCP server so that new clients waiting to be kickstarted can reach the Kickstart server, having obtained a valid DHCP address. Kickstart can also use other installation mediums, such as NFS and even local media if desired.

In this tutorial we are using the simplest method of Kickstart implementation, HTTP via a web server. The operating system used is CentOS 6.5. This Kickstart guide should work on any Red Hat derivative.

Installing Kickstart

The first step in setting up a Kickstart server is to install a basic web server to hold the Kickstart configuration files and OS installation files. It is assumed that there is already a basic CentOS web server ready to go, with a static IP address and GUI loaded. 

Due to testing in a private lab environment, we can disable SELINUX. Do this by manually editing /etc/selinux/config to set SELINUX=disabled.

We will also be disabling iptables in the environment with this command:

    chkconfig –level 35 iptables off

After this is done, you will need to reboot the host. Check that SELINUX is disabled by using the command 'getenforce.' It should report back as disabled.

Log in to the server as root and check to see if a web server is installed by opening a terminal session; use the following command to check if Apache web server is installed:

    yum info httpd

If the yum command shows the status as installed, skip the Apache web server installation and configuration steps below. If the server shows the Apache web server is not installed, install it using the command below as the root user in a terminal window:

    yum -y install httpd

Once the web server is installed, start it by using the command:

    service httpd start

There may be some warnings about being unable to resolve the hostname. In this instance it isn't a problem and the warning can be ignored. To check the web server is working, use the command:

    service httpd status

Make the web server automatically start on bootup, use the command:

    chkconfig –level 35 httpd on

Now the web server configuration steps are complete. Below are some rudimentary troubleshooting steps if something wasn't working correctly.

Troubleshooting Your Kickstart Installation

At this point the basic web server should be up and running, even if the server is rebooted. Check that it is working by using a web browser on a separate machine and try and load the web page of the server, using its IP address if needed. If you cannot browse to the web page I would suggest checking the following items:

  1. Check the basic connectivity between the two machines.
  2. Check the status of the Apache web server.
  3. Ensure that no firewalls are blocking port 80 traffic.

Assuming that everything is now working we can progress with setting up the Kickstart server.

Setting up Kickstart

To make the server work with Kickstart, we need to add some content to the web server in the form of installation files and Kickstart configuration files. Using the console or terminal session, create a folder in the web server document root. In CentOS using Apache, the default document root is


It is advisable that rather than just placing the files in the root of the web folder, create a folder layout that lends itself to running multiple versions of software and architectures for various Kickstart installs. Each CentOS version and architecture should have its own folder structure. To create a basic folder setup adhering to the above recommendation use the command:

    mkdir -p /var/www/html/centos/6/x64

The easiest way to copy the contents across to the new web server is to copy the contents from the installation media used to the relevant folder. This is done by using the following commands:

    mount /dev/cdrom /media
    cp -r /media/* /var/www/html/centos/6/x64/

Note: if a different version or operating system is being used, the media command will need to be modified to reflect the name of the mounted media; for example, CentOS_6.5_Final may need to be changed.

Once this is complete, it is time to start creating our Kickstart file. The Kickstart file holds what could be termed an "answers" file to questions that the installer needs to know in order to perform a complete installation. It is possible to manually create a kickstart file using a text editor but RHEL and CentOS provide a GUI Kickstart maker program.

Install the Kickstart builder application using the command:

    yum -y install system-config-kickstart.noarch

After installation is complete, notice that you have a new application, as shown above. Filling in the details field by field allows you to configure the settings for each configuration option. One thing to be aware of is the location of the installation files on the web server, especially as there is a nice ordered folder structure with various version folders. 

Once the Kickstart file is created, it needs to be saved to web servers' root folder so that any new clients can read it. It isn't required to be in the root, but a user will need to make adjustments when the guests are installed. As mentioned before, by default, the root folder is /var/www/html/ in a standard CentOS installation. When it comes to saving the file, it is advised to give each configuration created a simple but informative name.

Booting Your Kickstart

All the hard work is now done and all that is left to do is to boot off a minimal install CD (or any bootable install media).

Run the automated install by booting from the disk media. When the guests get to the boot screen press the tab key. This allows you to change or add options to the boot configuration.

Simply add the addition content, substituting the IP address for that of the web server in use and the ks.cfg file for the Kickstart file name when the test Kickstart file was created earlier.

    vmlinuz initrd=initrd.img ks=

Now the guest system will boot the initial kernel and load the Kickstart file. A user will, however, have to interact with the installer when it asks how the disks are to be configured. This is a safety measure to ensure a user really does want to wipe the disks in question; however, it can be overridden. If someone wants to do this, please, make sure they understand that removing this safety feature can be dangerous.

Why Use Kickstart?

Using Kickstart not only saves time, but it brings a certain amount of consistency into play, assuring that every machine created with the same Kickstart file will meet the same initial specification.

The above was only an example of what is possible with automatic deployment. Administrators can customize the Kickstart files with additional files and settings. To learn more about how to configure Kickstart file options, check out the Kickstart file pages at Red Hat. These will give administrators all the information that they need on Kickstart configuration.