How to Automate CentOS 6.6 Deployment with Kickstart: Step‑by‑Step Guide
This tutorial walks you through configuring a CentOS server for unattended installation using Kickstart, covering yum repository setup, required services (tftp, dhcp, http), firewall and SELinux adjustments, Kickstart file creation, and the final automated OS deployment.
In production environments where many identical systems need to be deployed, manually installing the operating system on each server is extremely time‑consuming; CentOS provides an unattended installation feature that can be configured with Kickstart.
1. Configure the local yum repository
Mount the installation CD to the /media/ directory and set up the yum source so that required packages can be installed.
2. Install required software
Install the following services:
tftp : simple file transfer protocol for providing boot files to clients.
dhcp : dynamic host configuration protocol for assigning IP addresses.
http : serves installation files to clients.
system-config-kickstart : tool for generating Kickstart configuration files.
3. Disable firewall and SELinux
Stop the firewall service and set SELinux to permissive or disabled mode.
4. Configure the TFTP server
1) Edit the TFTP configuration file and set disable="no".
2) Restart the TFTP service.
3) Verify the TFTP port.
4) Copy pxelinux.0 to /var/lib/tftpboot. If /usr/share/syslinux does not exist, install it with yum -y install syslinux.
5) Copy the isolinux directory from the installation CD to /var/lib/tftpboot.
6) Copy isolinux.cfg to /var/lib/tftpboot/pxelinux.cfg/default and rename it to default.
7) Edit the default file to customize the boot menu.
5. Configure DHCP
Edit /etc/dhcp/dhcpd.conf with the appropriate network settings and restart the DHCP service.
6. Configure HTTP
Create a directory under the HTTP document root and mount the installation CD into it so that installation files are accessible via HTTP.
7. Generate the Kickstart configuration file
1) Launch the Kickstart configuration tool from a terminal.
2) Fill in basic information such as language, timezone, and root password.
3) Choose the installation method (the example uses HTTP).
4) Define partitioning scheme, add network devices, disable SELinux and firewall, select software packages, and add post‑installation scripts.
5) Save the configuration file.
Note: any settings not explicitly covered can remain at their default values.
The partitioning commands used in the Kickstart file are: part – create a partition. part pv.ID – create a physical volume. volgroup VolGroup –pesize=4096 pv.01 – create a volume group.
logvol / –fstype="ext4" –name=lv_root –vgname=VolGroup –size=10240– create the root logical volume. logvol swap –name=lv_swap –vgname=VolGroup –size=2048 – create the swap logical volume.
8. Perform unattended installation of CentOS 6.6
Boot a bare‑metal machine; the custom boot menu defined in the default file appears. After the pre‑installation checks, the text‑mode installer runs automatically, and the system reboots into the newly installed OS.
Verification shows that the configured IP address, partitions, and post‑installation scripts (e.g., automatic yum repository creation) are all applied correctly.
Note: the steps above cover the most basic deployment; more complex installations can be achieved by extending the Kickstart file and post‑scripts.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
