First, pre-war theory
What is PXE?
PXE (Preboot Execute environment, pre-boot execution Environment) is the latest technology developed by Intel Corporation, working in the network mode of Client/server, just want hi workstation to download image from remote server through network, and thus support booting the operating system over the network, during the boot process, the terminal requires the server to assign an IP address, in TFTP (Trivial File Transfer Protocol) or MTFTP (Multicast Trivial file transfer PROTOCOL) protocol Uninstalls a boot package to native memory execution, this boot package completes the terminal basic software setup, thus booting the operating system from the pre-installed server. PXE can boot a variety of operating systems, such as: Windows 95/98/2000/windows 2008/xp/win 7/win8;
:
<span style=\ "\ \" Font-family:microsoft\ ">kickstart the core of the technology is: Automatic answer files (kickstart files), is the original in the installation process requires us to manually set the language, password, Network parameters are automatically set by reading and reading automatic answer files. That is, we need to write the settings of the operating system in advance to the automatic answer file, when the operating system begins to install, specify the installer to read the automatic answer file for automatic installation and deployment of the operating system
II. Installation and Deployment
The contents of the IP in the following configuration file must be filled out according to the actual environment, and cannot be copied
Do not pay attention to whether there are other DHCP servers in the intranet
1, install the server ip:192.168.0.70
2, the specific implementation steps are as follows
(1) Installing the DHCP service
[email protected] ~]# yum install-y dhcp[[email protected] ~]# vim/etc/dhcp/dhcpd.conflog-facility local7; Subnet 192.168.0.0 netmask 255.255.255.0 {range 192.168.0.150 192.168.0.200; Option Domain-name-servers 114.114.114.114; Option routers 192.168.0.1; Default-lease-time 600; Max-lease-time 7200; Next-server 192.168.0.70; FileName "pxelinux.0"; }
Configuration Description: Specifies the dynamic IP address assigned to the 192.168.0.0/24 network. The dynamic address pool is from 192.168.0.150 to 192.168.0.200; The client obtains the gateway address of the 192.168.0.1;TFTP address of 192.168.0.70, and the startup file name is called pxelinux.0
(2) Install and deploy TFTP service
[[email protected] ~]# yum install tftp-server -y[[email protected] ~]# vim /etc/xinetd.d/tftpservice tftp{ socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = ipv4}
Configuration Description: Shared path is/var/lib/tftpboot
(3) Copy the required boot files from the client to the TFTP server
[[email protected] ~]# yum install -y syslinux[[email protected] ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/#将光盘或ISO挂载到/media, Copy the boot image file and boot configuration file from the installation image to the TFTP shared directory [[Email protected] ~]# mount /dev/cdrom /mnt[[email protected] ~]# cp /mnt/isolinux/{vmlinuz,initrd.img} /var/lib/tftpboot/[[email Protected] ~]# mkdir /var/lib/tftpboot/pxelinux.cfg[[email protected] ~]# vim /var/lib/tftpboot/pxelinux.cfg/defaultdefault linux #prompt 1 timeout 600 display boot.msg menu background Splash.jpg menu title welcome to centos 6.8! 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 linux menu label ^install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img ks=nfs:192.168.0.70:/ks/ks.cfg label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd= initrd.img rescue label local menu label boot from ^local drive localboot 0xffff label memtest86 menu label ^memory test kernel memtest append -[[email protected] ~]# /etc/init.d/xinetd restart
Configuration Description: default Specifies the way to boot, that is, the following various boot methods starting with a label, kernel specifies the system kernel file, and the following KS parameter can specify the location of the auto answer file. This example is set to read the kickstart file by accessing the NFS share of 192.168.0.70.
(4) Create Kickstart auto answer file
[[email protected] ~]# mkdir /ks[[email protected] ~]# vim /ks/ks.cfg# platform=x86, amd64, or Intel EM64T#version=DEVEL# disable firewall rules iptablesfirewall -- disabled# installation System INSTALL#&NBSP;NFS server address IP, and the system image path on NFS nfs --server=192.168.0.70 --dir=/mnt# root Password (encrypted 123456) rootpw --iscrypted $1$16pxgd.m$c4ve6ojcmgfqvadgm0dse.# system authorization informationauth --useshadow --passalgo=sha512# Install textfirstboot --disable# American Keyboard keyboard us# system language using the character interface lang en_us# Off selinuxselinux --disabled# do not configure the graphical interface skipx# installation logging level to infologging --level=info# Restart reboot# system time zone timezone asia/shanghai# network configuration: Dynamic acquisition of IP, network card name eth0, boot automatically start Network service, do not turn on IPv6, host name ( Custom, can not write, default localdomain:localhost) network --bootproto=dhcp --device=eth0 --onboot=on --noipv6 --hostname=centos04# System boot Boot configuration: MBR bootbootloader --location=mbr# disk partition, ZEROMBR: Must have, otherwise the installation will be stopped in the format partition interface zerombrclearpart --all -- initlabel# Disk Partitioning method part /boot --fstype= "Ext4" --size=200part swap --fstype= "swap" --size=2000part / --fstype= "Ext4" --grow --size=1# script to be executed after installation is complete%post/sbin/ chkconfig --level 2345 atd off/sbin/chkconfig --level 2345 httpd off/ Sbin/chkconfig --level 2345 cups off/sbin/chkconfig --level 2345 smartd off/sbin/chkconfig --level 2345 bluetooth off/sbin/chkconfig --level 2345 sshd on/sbin/chkconfig --level 2345 snmpd on/usr/sbin/useradd tomcatmkdir /root/.ssh/chmod -R 600 /root/.ssh/%end# Customize some software packages, such as vim, dev tool% Packages@additional-devel@development@corevim-commonvim-enhancedvim-minimalwgetlrzsz%end
(5) Deploying NFS Services:
[[email protected] ~]# Yum install nfs-utils rpcbind-y[[email protected] ~]# vim/etc/exports/ks 192.168.0.0/255.255.2 55.0 (RO)/mnt 192.168.0.0/255.255.255.0 (RO) [[email protected] ~]#/etc/init.d/rpcbind start; /etc/init.d/nfs start
(6) Turn on the client
For first-time clients, there is no need to enter the BIOS change boot order, from the CD-ROM or hard disk can not be found naturally from the network to find the installation source
650) this.width=650; "src="%5c "title=" \ "1.png\"/"alt=" Wkiol1hwc4uqhjsiaaapdr7exb8810.png-wh_50 "/>
This article is from the "Wesley" blog, please be sure to keep this source http://szk5043.blog.51cto.com/8456440/1889967
Pxe+kickstart Unattended Installation