制作kickstart脚本批量自动安装Linux系统

制作kickstart脚本批量自动安装Linux系统

  kickstart脚本是自动应答系统在安装过程中一切问题的脚本文件,这个文件可以实现系统的自动安装,在系统安装完毕后会在系统的root家目录中生成,anaconda-ks.cfg这个文件就是以此系统为模板生成的kickstart脚本,文本编写kickstart难度大,而系统中的system-config-kickstart工具可以利用图形化制作kickstart。这里以安装Linux系统虚拟机为例:

步骤有三方面:

(一)安装图形制作工具

制作kickstart脚本批量自动安装Linux系统

打开图形kickstart制作工具如下:

制作kickstart脚本批量自动安装Linux系统

【1】时区选择上海;填写超级用户密码;选择安装后自启;默认图形界面

制作kickstart脚本批量自动安装Linux系统

【2】选择HTTP,其中HTTP server 为服务器ip,HTTP Directory 选择镜像的挂载点

制作kickstart脚本批量自动安装Linux系统

【3】选择第一个

制作kickstart脚本批量自动安装Linux系统

【4】均选择第一个,然后点击Add

制作kickstart脚本批量自动安装Linux系统

(1)设置/boot为200M

制作kickstart脚本批量自动安装Linux系统

(2)设置/swap为500M

制作kickstart脚本批量自动安装Linux系统

(3)设置剩下的硬盘均为/,这里表示为1

制作kickstart脚本批量自动安装Linux系统

【5】增添网关,名取为eth0;选择DHCP

制作kickstart脚本批量自动安装Linux系统

【6】选择默认的即可

制作kickstart脚本批量自动安装Linux系统

【7】选择关闭防火墙

制作kickstart脚本批量自动安装Linux系统

【8】这两步操作,选择默认

制作kickstart脚本批量自动安装Linux系统

【9】点击file,保存

制作kickstart脚本批量自动安装Linux系统

(二)配置脚本

【1】一定要复制,cp 到阿帕其,就是复制到 /var/www/html

制作kickstart脚本批量自动安装Linux系统

【2】kickstart资源共享

安装httpd

制作kickstart脚本批量自动安装Linux系统

开启httpd,设置开机自启;关闭防火墙,设置开机不自启。

制作kickstart脚本批量自动安装Linux系统 【3】配置ks.cfg文件 

制作kickstart脚本批量自动安装Linux系统

 在其后增加安装软件

制作kickstart脚本批量自动安装Linux系统

(三)检测kickstart语法

如为空则表示没有语法错误.

制作kickstart脚本批量自动安装Linux系统

(四)更改安装虚拟机的脚本

路径如下:

 制作kickstart脚本批量自动安装Linux系统

更改如下:

制作kickstart脚本批量自动安装Linux系统