I. Configuring the DHCP service
[[email protected] ~]# yum install dhcp-y[[email protected] ~]# cat/etc/dhcp/dhcpd.conf Ddns-update-style interim;subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.20 192.168.1.254;option routers 192.168.1.1;option subnet-mask 255.255.255.0;option domain-name-servers 192.168.1.1;option broadcast-address 192.168.1.255;default-lease-time 86400;max-lease-time 172800;next-server 192.168.1.1; # #tftpf服务器地址filename "pxelinux.0"; # # #网络启动}[[email protected] ~]# service DHCP start
Two. Configuring TFTP
[[email protected] ~]# yum install tftp-server[[email protected] ~]# vim /etc/xintd.d/tftp # #编辑使其打开tftp功能 [[email protected ] ~]# cat /etc/xinetd.d/tftp # default: off# description: the tftp server serves files using the trivial file transfer # Protocol. the tftp protocol is often used to boot diskless #workstations, download configuration files to network-aware printers, #and to start the installation process for some operating systems.service tftp{socket_type= dgramprotocol= udpwait= yesuser= rootserver= / usr/sbin/in.tftpdserver_args= -s /var/lib/tftpbootdisable= noper_source= 11cps= 100 2flags= ipv4}[[emaIl protected] ~]# service xinitd restart
Turn on firewall 69/udp
Three. Configure Syslinux
[[EMAIL PROTECTED] ~]# YUM INSTALL SYSLINUX[[EMAIL PROTECTED] ~]# CP /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/[[email protected] ~]# cp /mnt /images/pxeboot/initrd.img /var/lib/tftpboot/[[email protected] ~]# cp /mnt/images/ pxeboot/vmlinuz /var/lib/tftpboot/[[email protected] ~]# cp /mnt/isolinux/ vesamenu.c32 /var/lib/tftpboot/[[email protected] ~]# cp /mnt/isolinux/*.msg / Var/lib/tftpboot/[[email protected] ~]# cp /mnt/isolinux/splash.jpg /var/lib/tftpboot /[[email protected] tftpboot] ll Total dosage 38044-r--r--r--. 1 root root 84 9 month 1 04:27 boot.msg-r--r--r--. 1 root root 33383449 9 month 1 04:24 initrd.img-rw-r--r--. 1 root root 26828 9 Month 1 04:23 pxelinux.0drwxr-xr-x. 2 root root 4096 9 Moon 1 06:18 pxelinux.cfg-r--r--r--. 1 Root root 1236005 9 month 1 06:25 splash.jpg-r--r--r--. 1 root root 162860 9 Month 1 04:26 vesamenu.c32-r-xr-xr-x . 1 root root 4128944 9 Month 1 04:24 vmlinuz[[email protected] tftpboot]# [[email protected] ~]# mkdir /var/lib/tftpboot/ pxelinux.cfg[[email protected] ~]# cp /mnt/isolinux/isolinux.cfg /var/lib/ Tftpboot/pxelinux.cfg/default
[[email protected] pxelinux.cfg]# cat defaultdefault vesamenu.c32#prompt 1timeout 600display boot.msgmenu background splash.jpgmenu title welcome to Red Hat Enterprise Linux 6.5!menu 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 linux menu label ^install or upgrade an existing system menu default kernel vmlinuz append Ks=nfs:192.168.1.1:/tmp/ks. cfg inst.stage2=nfs:192.168.1.1/systemiso/rhel6 initrd=initrd.imglabel vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodesetlabel rescue menu label ^rescue installed system kernel vmlinuz append initrd=initrd.img rescuelabel local menu label boot from ^local Drive localboot 0xfffflabel memtest86 menu label ^memory test kernel memtest append -
Four. Configure NFS
[Email protected] tftpboot]# cat/etc/exports/systemiso/rhel6 * (rw)/tmp/* (rw) [[email protected] Tftpboot]#[[email Protected] ~]# mkdir-p/systemiso/rhel6[[email protected] ~]# cp-r/mnt/*/systemiso/rhel6[[email protected] ~]# chmod +r/systemiso/rhel6/*[[email protected] ~]# service NFS Start[[email protected] tftpboot]# CAT/ETC/EXPORTS/SYSTEMISO/RH EL6 * (rw)/tmp/* (rw)
Five. Create a Kickstart file
You can use the graphical configuration of the ks.cfg file [[email protected] tftpboot]# Yum install System-config-kickstart
Or just use the ks.cfg[[email protected] ~]# cat /tmp/ks.cfg #platform =x86, amd64 that you've created. or Intel EM64T#version=DEVEL# Firewall configurationfirewall --disabled# Install os instead of upgradeinstall# use nfs installation medianfs --server=192.168.110.1 --dir=/systemiso/rhel6# Root passwordrootpw --iscrypted $1$eq/x66ig$5qrmqf/zxbufarejjawlv.# system authorization informationauth --useshadow --passalgo=sha512# Use text mode installtextfirstboot --disable# system keyboardkeyboard us# system languagelang en_us# selinux configurationselinux --disabled# installation logging levellogging --level=info# reboot after installationreboot# system timezonetimezone africa/abidjan# network informationnetwork --bootproto=dhcp --device=eth0 --onboot=on# system bootloader configurationbootloader --location=mbr# clear the master boot recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning information #我给的硬盘8Gpart /boot --fstype= "Ext4" --size=500 part / --fstype= "Ext4" --size=6656part swap --fstype= "swap" --size=1000%packages@base@compat-libraries%end
Finally create the virtual machine, using the network PX boot can be installed automatically
This article is from the "Top-one" blog, make sure to keep this source http://onenice.blog.51cto.com/13201315/1965074
Dhcp+tftp+syslinux+nfs+kickstart