about installing the operating system using the PXE network (PXE+DHCPD+TFTP+HTTPD) under the Linux-centos 7 system

Source: Internet
Author: User

PXE (Pre-Boot execution Environment) is an Intel-designed protocol that enables a computer to boot over a network rather than from a local hard disk, optical drive, and so on.

Modern NICs, typically embedded with PXE-enabled ROM chips. When the computer boots, the BIOS puts the PXE client into memory execution and displays the Command menu,

After the user chooses, the PXE client will be placed on the remote operating system to be downloaded locally to run on the network.

>>>>>> here the author of the PXE network installation of CentOS 7 is documented below, first service side (CentOS 7) needs to prepare the environment as follows:

Operating System Image: Centos-7-x86_64-dvd-1503-01.iso // Extract to/var/www/html/cento directory

installation and configuration of the DHCPD service: can refer to "about the installation and configuration of DHCP services under Linux-centos 7"

installation and configuration of the TFTP service : Refer to the installation and configuration of the Tftp-server service under Linux-centos 7

If the connection fails, can go to the Author blog network: http://www.cnblogs.com/5201351 to find

===========================================================================

1, in addition to the above environment, we also need to install the HTTPD service, and then to httpd the default root directory to create the CentOS directory, and the system image is attached to this

[Email protected]5201351yuminstall httpd-y[[email protected]5201351 mkdir /var/www/html/centos[[email protected]5201351Mount centos-7- x86_64-dvd-1503-Iso/var/www/html/centos

2. Install the Syslinux package using Yum and install the directory for this package primarily to obtain pxelinux.0 files that are useful for PXE network installation

After installing the Syslinux package, we need to copy the pxelinux.0 file to the TFTP default root:/var/lib/tftpboot

[Email protected]5201351yuminstall syslinux  -y[[email protected]  5201351cp /usr/share/syslinux/pxelinux. 0 /var/lib/tftpboot/   //pxelinux.0, is a bootloader, similar to grub, through which to load kernel

3, the next step is to prepare the TFTP root directory, mainly in the system image of the file into the TFTP root directory, in addition to the default file, all other places in the TFTP root directory

[[Email protected]5201351~]#mkdir/var/lib/tftpboot/pxelinux.cfg#########################################################################################[[ Email protected]5201351~]# cd/var/www/html/Centos[[email protected]5201351centos]#CPisolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/Default[[email protected]5201351centos]#CPIMAGES/PXEBOOT/{VMLINUZ,INITRD.IMG}/var/lib/tftpboot/[[Email protected]5201351centos]#CPIsolinux/{vesamenu.c32,boot.msg,splash.png}/var/lib/tftpboot/

At this point, we can see the structure of the/var/lib/tftpboot directory as follows:

============================================================================

4, Next is the configuration Pxelinux.cfg/default file, here we can simply modify the value of append INITRD Item

label Linux   7 Menu default// After setting this item, just this menu is selected as the boot menu kernel   vmlinuz append                                                                   INITRD=initrd.img inst.ks=http://192.168.0.1/ks.cfg quiet            //  The location of the Ks.cfg file is noted here, i.e. unattended automatic installation  #append initrd=initrd.img inst.stage2=hd:label=centos\x207\x20x86_64 Quiet  // This is the default value, and we'll comment it

Note: If we are simply installing using the PXE network on an unattended basis, you only need to set the Inst.stage2=http://192.168.0.1/centos to

============================================================================

5, if only the reality of the installation of a person on duty, only need the above operation, the server has implemented the PXE network installation function

Of course we are in the work, probably more need to use the PXE and KickStart Reality Operating system unattended installation, so we may

You will also need to install the System-config-kickstart package, and you can use the System-config-kickstart command to generate the Ks.cfg file when the installation is complete

Of course, if we are familiar with the configuration of the Ks.cfg file, we can also create the/var/www/html/ks.cfg file directly, the author creates the Ks.cfg content as follows:

# Platform=x86, AMD64, or Intel em64t# version=devel# Install OS instead of upgradeInstall# Keyboard Layoutskeyboard--vckeymap=us--xlayouts='US'# Reboot after installationreboot# Root PASSWORDROOTPW--iscrypted $6$Pf 08dlf16p7svb6o$yngemfbptrppgxt.h6r6mihknhf3s/34mamd1jarsu2ri08hn/wfb6aywybrrajmw0jhqra1vfoggnngj6usl1# System timezonetimezone Asia/shanghai--isutc# Use network Installationurl--url="Http://192.168.0.1/centos"#最后面不需要加/# System Languagelang en_US. UTF-8--addsupport=zh_cn. utf-8# Firewall Configurationfirewall--disabled# Network informationnetwork--BOOTPROTO=DHCP--onboot=yes--noipv6--hostname=5201351# System Authorization Informationauth--useshadow--passalgo=sha512# Use graphicalInstallGraphicalfirstboot--disable# SELinux Configurationselinux--disabled# System bootloader configuration# new Hard drive needs to be created Mbrbootloader--location=mbr# Clear The Master Boot recordzerombr# Partition clearing Informationclearpart--all--Initlabel # Disk Partitioning information#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Part PV.123--fstype="LVMPV"--ONDISK=SDA--size=953336 Part/boot--fstype="XFS"--ONDISK=SDA--size= -Volgroup CentOS--pesize=4096Pv.123Logvol/data--fstype="XFS"--size=613365--name=data--vgname=Centoslogvol Swap--fstype="Swap"--size=32764--name=swap--vgname=Centoslogvol/Home--fstype="XFS"--size=204800--name=home--vgname=Centoslogvol/--fstype="XFS"--size=102400--name=root--vgname=centos#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%Packages@core@chinese-SUPPORTVIMNTP%end#########################################################################%Post##%end

6. Finally, we use the following command to start the services, the client in the network into an unattended PXE network installed.

[Email protected]5201351 ~]# systemctl restart Dhcpd.service[[email protected]5201351 ~ ]# systemctl Restart Xinetd.service[[email protected]5201351 ~]# systemctl Restart tftp.socket[[ Email protected]5201351 ~]# systemctl restart Tftp.service[[email protected]5201351 ~ ]# systemctl Restart Httpd.service

Respect for the work of others reproduced please be sure to indicate the source: http://www.cnblogs.com/5201351/p/5128912.html

about installing the operating system using the PXE network (PXE+DHCPD+TFTP+HTTPD) under the Linux-centos 7 system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.