Article Directory
- Unattended installation using answering tools
-
- Install the system-config-kickstart tool
- Open the "Kickstart Configuration Program" window
- Configure kickstart options
- Save the auto answer file
- Configure the packages that need to be installed
- Copy the edited ks to var/ftp/
- Edit the boot menu file default, add ks boot parameters
- Verify unattended installation
Unattended installation using answering tools
Install the system-config-kickstart tool
yum install -y system-config-kickstart
Open the "Kickstart Configuration Program" window
Open through the desktop menu "Applications" -> "System Tools" -> "Kickstart"
or
execute the "system-config-kickstart" command to open
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".
Installation method:
select FTP
FTP server:
ftp://192.168.80.10 FTP directory: centos7
boot loader option:
"installation type": install a new boot loader
"install option": install the boot loader in the master boot record (MBR) Program
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
Network configuration:
add network device "ens33"
Network type is set to "DHCP"
Firewall configuration:
Disable SELinux, disable firewall
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
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
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
Copy the edited ks to var/ftp/
cp /root/ks.cfg /var/ftp/ks.cfg
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 路径
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.