要想配置kickstart ,首先要配置个本地yum源,要不然用system-config-kickstart时选不上包。而且,centos6的yum 源的名字一定是[base],要不然会报:
Package selection is disabled due to problems downloading package information.
centos7要把仓库名称更改为development
[development]
name=base
baseurl=file:///mnt/
利用安装system-config-kickstart
yum -y system-config-kickstart
如果不能启动,用xshell,连接,左键属性,隧道勾选转发X11连接到(X),选择Xmanager(M)
安装httpd服务,执行system-config-kickstart时会用到httpd服务来对安装文件目录进行配置
yum -y install httpd
mkdir /var/www/html/7/x86_64 -p
mount /dev/sr0 /var/www/html/7/x86_64
systemctl start httpd
二、设置dhcp服务器
rpm -ivh /var/www/html/6/Packages/dhcp-4.1.1-60.P1.el6.centos.x86_64.rpm
vim /etc/dhcp/dhcpd.conf
option domain-name "magedu.com"; ping自动补全
option domain-name-servers 192.168.0.1,8.8.8.8; DNS1DNS2
default-lease-time 86400; 默认租期
max-lease-time 86400; 客户端可获取的最长租期
subnet 192.168.100.0 netmask 255.255.255.0 { 网段及掩码
range 192.168.100.1 192.168.100.200; 分配的ip地址
option routers 192.168.100.1; 分配的网关地址
}
service dhcpd start
vim /var/lib/dhcpd/dhcpd.leases 查看分配记录
三、设置tftp服务器
yum -y install tftp-server
vim /etc/xinetd.d/tftp
disable = no
service xinetd start
ss -unlp | grep xinetd 查看是否监听udp的69端口
tftp共享文件目录在/var/lib/tftpboot
四、准备pxe安装centos系统
mkdir /var/lib/tftpboot/pxelinux.cfg/
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cd /misc/cd/images/pxeboot/
cp vmlinuz initrd.img /var/lib/tftpboot
Cd /misc/cd/isolinux/
cp boot.msg vesamenu.c32 splash.jpg /var/lib/tftpboot
vim /var/lib/tftpboot/pxelinux.cfg/default
default vesamenu.c32 指定菜单风格
#prompt 1
timeout 600
display boot.msg
menu background splash.jpg
menu title Welcome to wang CentOS 6
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label auto
menu label ^Automatic Install Centos6
kernel vmlinuz
append initrd=initrd.img ks=http://192.168.100.100/centos/ks/centos6.cfg
label manual
menu label ^Manual Install Centos
kernel vmlinuz
append initrd=initrd.img inst.repo=http://192.168.100.100/centos/6
label local
menu default
menu label Boot from ^local drive
localboot 0xffff
tree /var/lib/tftpboot/
/var/lib/tftpboot/
├── boot.msg
├── initrd.img
├── pxelinux.0
├── pxelinux.cfg
│ └── default
├── splash.jpg
├── vesamenu.c32
└── vmlinuz
开机选择pxe启动方式,选择安装菜单,自动安装成功!