Introduction:
To automate the installation of Red Hat Enterprise Linux a feature called Kicstart. A single file containing the answers to all the questions that would normally be asked during a typical installation. Kickstart installation can be performed using a local CD-ROM, a local hard drive, or via NFS, FTP, or HTTP. Kickstart perform Automatic installations of RHEL/CentOS7, without the need for user intervention, the machines using a kickstart file read from a local FTP server. Kickstart in Red Hat Enterprise Linux is similar to unattended installation for Microsoft Windows. The default configuration file for kickstart “anaconda-ks.cfg” is available in the home directory of the root user. In kickstart configuration file lines start with # characters are comments that are ignored by the installer. Line that starts with a % character and end with the %end is directive. The %packages section specifies the software to be installed on the target system. %post, Configure the system after all the software has been installed. The %pre, script is executed before any disk partitioning is done.
Install GUI package of kickstart [root@asim ~]#yum install –y system-config-kickstart |
Install FTP for network access [root@asim ~]#yum install –y vsftpd |
Start FTP service [root@asim ~]#systemctl start vsftpd |
Start FTP service on boot [root@asim ~]#systemctl enable vsftpd |
Mount CentOS DVD to FTP folder [root@asim ~]#mount /dev/cdrom /var/ftp/pub/ |
Temporary disable SELinux Security [root@asim ~]#setenforce 0 |
Stop Firewall temporary or Add the firewall for FTP [root@asim ~]#systemctl stop firewalld or [root@asim ~]#firewall-cmd – -permanent – -add-service=ftp |
After add role reload the firewall [root@asim ~]#firewall-cmd – -reload |
Open kickstart from command line Or Open kickstart from graphically [root@asim ~]#systemctl system-config-kickstart or Application > System Tools > Kickstart |
1) Basic configuration
Select Default Language = English USA
keyboard = U.S English
Time zone = Asia/Kolkata
Set root password = 123456
Confirm root password = 123456
Check the check box of “Reboot system after installation”
2) Installation Method
Click the radio button of “Perform new installation”
In installation device select FTP
In FTP server: Type your system IP “192.168.220.138”
In FTP directory: type “pub”
3) Boot loader option
Click on Install new boot loader
In Installation options, choose “Install boot loader on MBR”
4) Partition Information
In Master Boot Record option click on “clear Master Boot Record”
In Partition option click on “Remove all existing partitions”
In disk label click on “Initialize the disk label”
Click on Add
Mount point “/”
File system “xfs”
File size(MB) “20480”
Ok
Click on Add
Mount point “/boot”
File system “xfs”
File size(MB) “2048”
Ok
Click on Add
File system “swap”
File size(MB) “1024”
Ok
5) Network Configuration
Network device :eth0
Network type :DHCP
ok
6) Authentication
Leave as it is
7) Firewall configuration
Disable SELinux
8) Display configuration
Leave as it is
9) Package Selection
Do this later
10) Pre installation and post installation script
Write script or leave this step
Go to file and save with name “ks.cfg” in “/var/ftp” directory
[root@asim ~]#cd ~
[root@asim ~]#ls
[root@asim ~]#gedit anaconda-ks.cfg
Copy packages
[root@asim ~]#gedit /var/ftp/ks.cfg
Paste packages at the end of the file
Save and close
Copy the save kickstart file syntax [root@asim ~]#cp ks.cfg /var/ftp/ |
Set permission on kickstart file [root@asim ~]#chmod 755 /var/ftp/ks.cfg |
Check for kickstart file syntax [root@asim ~]#ksvalidator /var/ftp/ks.cfg |
Setup New Virtual Machine and follow the steps below:
Press Tab on Client and type FTP location ks=ftp://192.168.220.138/pub/ks.cfg |
Press Tab on Client and type FTP location ks=ftp://192.168.220.138/ks.cfg with ip=192.168.220.140 netmask=255.255.255.0-static IP and gateway configuration |