Implement Kickstart unattended installation

Unattended installation using answering tools

Install the system-config-kickstart tool

yum install -y system-config-kickstart
Insert picture description here
Insert picture description here

Open the "Kickstart Configuration Program" window

Open through the desktop menu "Applications" -> "System Tools" -> "Kickstart"
or
execute the "system-config-kickstart" command to open
Insert picture description here

Configure kickstart options

Basic configuration: The
default language is set to "Chinese (Simplified)"
, the time zone is set to "Asia/Shanghai" and the
root password is set. In the
advanced configuration, check "Restart after installation".
Insert picture description here
Installation method:
select FTP
FTP server:
ftp://192.168.80.10 FTP directory: centos7
Insert picture description here
boot loader option:
"installation type": install a new boot loader
"install option": install the boot loader in the master boot record (MBR) Program
Insert picture description here
Partition Information:
Master Boot Record: Clear Master Boot Record
Partition: Delete all existing partitions
Disk Label: Initialize Disk Label
Layout: Add Partition
Mount Point: /boot, File System Type: xfs, Fixed Size: 500M
File System Type: swap , Fixed size: 4096M
mount point: /home, file system type: xfs, fixed size: 4096M
mount point: /, file system type: xfs, use all unused space on the disk
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Network configuration:
add network device "ens33"
Network type is set to "DHCP"
Insert picture description here
Firewall configuration:
Disable SELinux, disable firewall
Insert picture description here
Post-install script:
check "Use interpreter": /bin/bash
rm -rf /etc/yum.repos.d/*
echo'[local]
name=local
baseurl=ftp://192.168.80.10/centos7
enabled=1
gpgcheck=0’ > /etc/yum.repos.d/local.repo

Keep other options at the default settings
Insert picture description here

Save the auto answer file

Select the "File" -> "Save" command in the "Kickstart Configuration Program" window, and select the specified save location. The file name is ks.cfg and
is saved in /root/ks.cfg by default

Insert picture description here
Insert picture description here

Configure the packages that need to be installed

You can copy the package installation script of /root/anaconda-ks.cfg to the ks.cfg file as needed, just copy the %packages to the %end part.
If minimum installation is required, you can copy the following content:
vim ks.cfg
%packages
@^minimal
%end
Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here

Copy the edited ks to var/ftp/

cp /root/ks.cfg /var/ftp/ks.cfg
Insert picture description here

Edit the boot menu file default, add ks boot parameters

vim /var/lib/tftpboot/pxelinux.cfg/default	
default auto 							
prompt 0 								#设置是否等待用户选择,“0”表示不等待用户控制

label auto								
kernel vmlinuz							#kernel 和 append用来定义引导参数
append initrd=initrd.img method=ftp://192.168.80.10/centos7 ks=ftp://192.168.80.10/ks.cfg
#添加 ks 引导参数以指定 ks.cfg 应答文件的 URL 路径

Insert picture description here

Verify unattended installation

When the client computer boots in PXE mode each time, it will automatically download the ks.cfg response configuration file, and then install the CentOS 7 system according to the settings therein without manual intervention.

Guess you like

Origin blog.csdn.net/Jun____________/article/details/114115938