anaconda-ks.cfgkickstart脚本:企业安装多台系统时,kickstart代替人工回答系统设定问题的文件。
1.实验环境
关闭火墙systemctl disabled --now firewalld
查看
关闭selinux= setenforce o ;开启
getenforce 查看selinux的开关
2.dhcp 创建 设置地址池
开启dhcp
3.kickstart文件制作
虚拟机的 httpd 服务打开
可
cd /root
将其中 anaconda-ks.cfg文件cp到建立的 /var/www/html/ks/westos.ks 中/
编辑文件var/www/html/ks/westos.ks
如下
#version=RHEL8
#ignoredisk --only-use=vda
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
#graphical
text
# Use CDROM installation media
#cdrom
url --url="http://172.25.254.72/westosir/" 镜像所在仓库
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8
# Network information
network --bootproto=dhcp --onboot=on --ipv6=auto --no-activate
network --hostname=westoslinux.westos.org
repo --name="AppStream" --baseurl=http://172.25.254.72/westosir/AppStream
# Root password
#rootpw --iscrypted $6$zG/VOV5ipdlpG7g1$D8HNdxYK7MpKDD6475WQKYaAx7sSgdxXaRUbL7cjZq2riEwm.FSNQgc.27baOQStDht8tXmtWNlOvk7mEQ6oX1
rootpw --iscrypted $6$J1gR1biu8nQ4TEje$qrtTD1eSZoA.q24X6ckyJS11GVYNd.U8JM3DopPlLBoTBnVY/2DUgSUXaGRUSjv2IiN7UU2ZPPyYgHXdtx7SY
# Run the Setup Agent on first boot
firstboot --disable
# Do not configure the X Window System
skipx
reboot
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
#user --name=westos --password=$6$YAe.8sw6vifDVnKA$3Og7IGTQft5nntRNgMLm0SFntVgYeF/0rU5ui54uKdAAlPv0YI3knIR41Zwvlcjli4j4vVpGVyN2YOzsLsFS91 --iscrypted --gecos="westos"
# Disk partitioning information
part / --fstype="xfs" --size=1 --grow
part swap --fstype="swap" --size=500
part /boot --fstype="xfs" --size=1024
%packages
@base
gcc
%end
%post
touch /mnt/file{1..5}
%end
chmod 644 /var/www/html/ks/westos.ks
测试 通过浏览器查看
建立虚拟机
virt-manager
图形
上边为镜像地址 下为kickstart文件位置
接着按顺序建立即可