用脚本自动安装虚拟机
Kickstart 使用kickstart,系统管理员可以创建一个包含安装期间所有常见问题的答案的文件,以自动安装red hat enterprise linux
Kickstart 制作工具安装
软件包 system-config-kickstart
安装yum install system-config-kickstart
yum install httpd system-config-kickstart -y
安装成功!
ssh [email protected] -X ####图形连接
执行 system-config-kickstart 命令
进入图形界面后选择自动安装过程中需执行的选项
1.设置密码,重启选项
2,选择HTTP服务,设置IP,镜像名称
3,选择磁盘分配
给boot分区200m,swap500m,其余都给根目录
authentication选项如下
火墙选择不打开不自启
display选择不自启
将ks.cfg保存在file system /var/ www /html/
打开httpd 关闭火墙
systemctl start httpd
systemctl stop firewalld
打开火狐,输入172.25.254.163/ks.cfg
设置 ks.cfg 的配置文件添加所需要的安装包
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
ks.cfg software
[root@localhost html]# vim ks.cfg
里面改
38
39
40 %packages
41 @bash
42 lftp
43 %end
ksvalidator ks.cfg 语法检查
无提示代表无错误
编辑vm-create.sh
给脚本执行权限
并执行
自动装机成功,如图