本文共 2425 字,大约阅读时间需要 8 分钟。
一、配置kickstart应答文件
要想配置kickstart ,首先要配置个本地yum源,要不然用system-config-kickstart时选不上包。而且,centos6的yum 源的名字一定是[base],要不然会报:Package selection is disabled due to problems downloading package information.centos7要把仓库名称更改为development[development]name=basebaseurl=file:///mnt/利用安装system-config-kickstartyum -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 -pmount /dev/sr0 /var/www/html/7/x86_64systemctl start httpd二、设置dhcp服务器rpm -ivh /var/www/html/6/Packages/dhcp-4.1.1-60.P1.el6.centos.x86_64.rpmvim /etc/dhcp/dhcpd.confoption domain-name "magedu.com"; ping自动补全option domain-name-servers 192.168.0.1,8.8.8.8; DNS1DNS2default-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 startvim /var/lib/dhcpd/dhcpd.leases 查看分配记录三、设置tftp服务器yum -y install tftp-servervim /etc/xinetd.d/tftpdisable = no service xinetd startss -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/tftpbootCd /misc/cd/isolinux/cp boot.msg vesamenu.c32 splash.jpg /var/lib/tftpbootvim /var/lib/tftpboot/pxelinux.cfg/default
default vesamenu.c32 指定菜单风格#prompt 1timeout 600display boot.msgmenu background splash.jpgmenu title Welcome to wang CentOS 6menu color border 0 #ffffffff #00000000menu color sel 7 #ffffffff #ff000000menu color title 0 #ffffffff #00000000menu color tabmsg 0 #ffffffff #00000000menu color unsel 0 #ffffffff #00000000menu color hotsel 0 #ff000000 #ffffffffmenu color hotkey 7 #ffffffff #ff000000menu color scrollbar 0 #ffffffff #00000000label automenu label ^Automatic Install Centos6kernel vmlinuzappend initrd=initrd.img ks=label manualmenu label ^Manual Install Centoskernel vmlinuzappend initrd=initrd.img inst.repo=label localmenu defaultmenu label Boot from ^local drivelocalboot 0xfffftree /var/lib/tftpboot//var/lib/tftpboot/├── boot.msg├── initrd.img├── pxelinux.0├── pxelinux.cfg│ └── default├── splash.jpg├── vesamenu.c32└── vmlinuz开机选择pxe启动方式,选择安装菜单,自动安装成功!转载于:https://blog.51cto.com/14233913/2381959