这个程序运行起来之后,在安装过程中的所有选择都会有,但是我在这里出了个问题,软件包一项加载失败,所以在客户端安装的时候还要选择安装哪些包,比如语言支持、开发工具、图形桌面等等,配置之后生成ks文件,然后点击file-save as 选项把文件另存在/ks这个文件下面
查看ks.cfg文件,看看里面有什么东西
[root@CentOS ~]# cat /ks/ks.cfg //其实都是我们刚才在图形界面配置的,只是生成配置文件保存在这个ks.cfg中
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --none
# Use text mode install
text
# Firewall configuration
firewall --disabled //未启用防火墙,因为刚才在图形界面我们选择的是disable
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US //默认语言选项是英文
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.10.172 --dir=/mnt/install //nfs服务器地址和安装目录
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on 启用DHCP
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$z1ZIzNVh$OHXbaV5.JJR.LGF4uPFD0/ //设置root口令并加密
# SELinux configuration
selinux --disabled
# System timezone
timezone --isUtc Asia/Shanghai
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=1024x768 --startxonboot
# Disk partitioning information
part /boot --asprimary --bytes-per-inode=4096 --fstype="ext3" --size=150 //设置的分区信息
part / --asprimary --bytes-per-inode=4096 --fstype="ext3" --size=16000
part swap --bytes-per-inode=4096 --fstype="swap" --size=2048
*************然后不要忘了/ks/ks.cfg这个文件的权限,如果没有权限客户端是没有权限读取内容的****************
*******************把服务端的防火墙和selinux先关闭,防止后面无法正常安装********************
[root@Centos ~]# ll /ks/ks.cfg
-rwxrwxrwx 1 root root 1200 Jun 6 11:52 /ks/ks.cfg //这里我给我是777
重启所有相关服务
[root@Centos ~]# service dhcpd restart
[root@Centos ~]# service xinetd restart
[root@Centos ~]# service portmap restart
[root@Centos ~]# service nfs restart
下面开启要安装系统的机器进入BIOS设置从网络启动,这时候就会出现DHCP请求,如果找到就会提示启动系统然后就开始安装
*************安装完成后一定要把服务器的光盘给卸载或者弹出光驱,否则客户端安装完成后重启又会重新开始这个操作***************************
实验仍有不完善的地方,就是那个配置ks.cfg图形界面的时候软件包无法获取,导致最后安装的时候还需要人工干涉选择相关软件包才能顺利安装完成
