How to create kickstart file for automated network installation of linux

Kickstart answer file usually "ks.cfg" can fully automate the linux installation process by answering all the questions that would normally be asked during a manual installation.

Kickstart file can be created via GUI on CentOS as follows:

1. Install Kickstart Configurator package.

# yum install -y system-config-kickstart

2. Run Kickstart Configurator

Press {Alt}+{F2} to run application and enter command: /usr/bin/system-config-kickstart

3. Basic Configuration

Select Default Language, Keyboard and Timezone as per your requirement, set Root user Password and tick the box to encrypt it. Select your Target machine architecture and tick the box Reboot system after installation.


4. Installation Method

You can choose to perform new installation or upgrade an existing installation. Also mention kickstart network installation source which can be configured to NFS, FTP, or HTTP.


5. Boot Loader Options

Select “Install new boot loader” and “install boot loader on Master Boot Record (MBR)” for fresh installation. You can set GRUB password here.


6. Partition Information

Hard partition layout may be set as per your scenario, if HDD partition is not standaridized through out network you may left hard disk partition parameters unanswered. This means user interaction is expected for hdd partition layout during installation.


7. Network Configuration

You can set Network Device as eth0, eth1. Also set DHCP to obtain IP Address or configure static IP Address.


8. Authentication Configuration

For local user authentication select SHA512 algorithm for password.
If NIS, LDAP, Kerberos or SMB server available for Network Authentication of your linux client, set it accordingly.


9. Firewall Configuration

Enable or disable Linux Firewall and SELinux, I have disabled both of them.


10. Display Configuration

Here you can choose to install linux with graphical environment.
You can also enable or disable the first boot agent.


11. Package Selection

You can select packages to install by kickstart file on fresh machine.


12. Pre-Installation Script

Carefully include scripts to execute before kickstart begins.


13. Post-Installation Script

Carefully include scripts to execute after kickstart finishes.


14. Save Kickstart File

Final step is to save kickstart file:
Go to File -> Save -> ks.cfg.

15. Generated ks.cfg file.

#platform=x86, AMD64, or Intel EM64T
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
# Use network installation
url --url="http://media.projectz.local/centos6/x64"
# Root password
rootpw --iscrypted $1$xDv9J2ER$C2qJgUQIOIbfXotDnbPU30
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
# System timezone
timezone Asia/Kolkata
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all

You may also like...

%d bloggers like this: