Pxe+kickstart implementation of network-based unattended installation operating system

Source: Internet
Author: User
Tags file transfer protocol

Network-based unattended installation operating system

Brief introduction:


1. 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, enabling workstations to download images from remote servers over the network, This supports booting the operating system over the network, and during the boot process, the terminal requires the server to assign an IP address, then TFTP (trivial File Transfer Protocol) or MTFTP (Multicast trivial file transfer Protocol) protocol to download a boot package to native memory execution, completed by this boot package terminal (customer? Basic software settings to boot the terminal operating system that is pre-installed in the server.

         strictly speaking, PXE is not a way to install, but a way to boot. A requirement for a PXE installation is that a PXE-supported network card (NIC) must be included on the computer to be installed, that is, the PXE Client must be in the network card. The PXE protocol enables a computer to boot over the network. This protocol is divided between the client side and the Server side, while the PXE client is in the ROM of the NIC. When the computer boots, the BIOS directs the PXE client into memory and then the files that are placed at the remote end by the PXE client are downloaded locally to run on the network. Running the PXE protocol requires setting up a DHCP server and a TFTP server. The DHCP server assigns an IP address to the PXE client (the host that will install the system), and because it assigns an IP address to the PXE client, the appropriate PXE settings need to be added when configuring the DHCP server. In addition, the TFTP client already exists in the PXE client ROM, so it can download the required files via the TFTP protocol to the TFTP Server.               

2, Kickstart

Kickstart is an unattended installation method. It works by documenting typical parameters that require manual intervention during the installation process and generating a file named Ks.cfg. If you have to fill in the parameters during the installation process (not limited to the machine that generated the Kickstart installation files), the installer will first look for the files generated by the kickstart, and if the appropriate parameters are found, use the found parameters; Need to be manually intervened by the installer. So, if the kickstart file covers all the parameters that may be required during installation, then the installer can simply tell the installer where to fetch the ks.cfg file and then go to work on it. When the installation is complete, the installer restarts the system according to the settings in the Ks.cfg and ends the installation. When installing multiple machines, no manual interaction is required, eliminating the need for management time.


Topology diagram:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/70/7F/wKioL1W44nfDCW_yAAE2dSphnfc565.jpg "title=" three. jpg " alt= "Wkiol1w44nfdcw_yaae2dsphnfc565.jpg"/>

Lab Environment:

VMware Workstation10,

centos 6.5 (minimum installation) , network mode   Host mode only, turn on DHCP , Close firewall ,

Remote Connection tool: Xmanager Enterprise 4

Host Address: 192.168.3.100

DHCP address pool: 192.168.3.101--192.168.3.200

TFTP, vsftp installation tree and boot programs are all on this machine

Principle:

First install DHCP, tftp-server, VSFTP, then configure the appropriate server, DHCP server to configure, "pre-installed IP address pool, and TFTP server location", tftp-server main Configuration "network boot driver, drive image, kernel, The bootloader configuration file "generates the Ks.cfg file with the System-config-kicksart tool and then feeds the bootloader anaconda, because System-config-kicksart relies on the desktop, So if you're working on a physical machine, you'll also need to install X Windows and Desktop table packs, because I'm using Xmanager Enterprise 4, which comes with a desktop system, so there's no desktop installation, vsftp mostly "put ks.cfg files, install trees 】

Build the FTP server, place the generated ks.cfg in the root directory of the FTP, and place the installation tree of the system that will be installed (that is, the CD-ROM and directory files.

The purpose of the Ks.cfg file is to customize the interactive information of the machine to be installed, [language keyboard network firewall SELinux partition] can be placed on the CD, u disk, server/directory.

Step One:

First install DHCP, tftp-server, VSFTPD

[[email protected] ~]# Yum--disablerepo=\*--enablerepo=c6-meida install DHCP tftp-server vsftpd-y

Second, configure the DHCP server

[Email protected] ~]# vim/etc/dhcp/dhcpd.conf

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/82/wKiom1W4ziCCgfkBAACji142Mbw416.jpg "title=" 2015-07-29_150119.png "alt=" Wkiom1w4ziccgfkbaacji142mbw416.jpg "/>

This is the configuration file for DHCP, you can set the sample configuration file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/7F/wKioL1W40TuD--9NAAB9auZ6i1g659.jpg "title=" 2015-07-29_150512.png "alt=" Wkiol1w40tud--9naab9auz6i1g659.jpg "/>

Remove the unwanted, here I will delete 37 lines below

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W40lOxYGKOAADwQR4hJgE724.jpg "title=" Qq20150729160239.png "alt=" Wkiol1w40loxygkoaadwqr4hjge724.jpg "/>

Save exit

Third, configuration Tftp-server

Copy the kernel and drive image on the CD to the home directory of the TFTP site

[Email protected] tftpboot]# cp/media/cdrom/isolinux/vmlinuz/[[email protected] tftpboot]# Cp/media/cdrom/isolinux /initrd.img./

Install the network boot program and copy to the current directory

[email protected] tftpboot]# Yum--disablerepo=\*--enablerepo=c6-media install syslinux-y cp/usr/share/syslinux/ pxelinux.0/var/lib/tftpboot/

Create a folder for the configuration file of a boot program

[[email protected] tftpboot]# mkdir pxelinux.cfg * * * name to be written in the name of this rule

Copy a configuration file for the network boot program to the newly created directory (I'll also use the profile on the CD)

[Email protected] tftpboot]# cp/media/cdrom/isolinux/isolinux.cfg pxelinux.cfg/default * * *

Name to be the default

Modify the configuration file default, which is the location of the ks.cfg and installation tree for the network boot

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W42KqQhwKAAAN_vtmdX7c533.jpg "title=" Qq20150729173230.png "alt=" Wkiol1w42kqqhwkaaan_vtmdx7c533.jpg "/> Four, FTP server configuration

Vsftp "Place a ks.cfg file, install tree"

1, produce ks.cfg file, first install package System-config-kickstart


Set the Yum source before executing the Kickstart command

[Email protected] yum.repos.d]# mkdir linshi[[email protected] ~]# cd/etc/yum.repos.d/[[email protected]]# MV Centos-base.repo Centos-debuginfo.repo Centos-vault.repo./linshi[[email protected] YUM.REPOS.D] #vim Centos-media.repo

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/70/83/wKiom1W43gnh1wKVAADDaIovWS8071.jpg "title=",. png " alt= "Wkiom1w43gnh1wkvaaddaiovws8071.jpg"/>

[Email protected] ~]# System-config-kickstart


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/82/wKiom1W42IyStkmXAAL5WGR-OAo929.jpg "style=" float: none; "title=" Qq20150729165648.png "alt=" Wkiom1w42iystkmxaal5wgr-oao929.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W42n7iNDOSAAIJ8OUBrv8741.jpg "style=" float: none; "title=" Qq20150729165951.png "alt=" Wkiol1w42n7indosaaij8oubrv8741.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/82/wKiom1W42JOg4b1lAAHOBvlwnoo022.jpg "style=" float: none; "title=" Qq20150729170129.png "alt=" Wkiom1w42jog4b1laahobvlwnoo022.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/7F/wKioL1W42oviVOy7AAJeRxCvenY567.jpg "style=" float: none; "title=" Qq20150729170506.png "alt=" Wkiol1w42ovivoy7aajerxcveny567.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/82/wKiom1W42J6xUyb5AADAqAdkh9Q886.jpg "style=" float: none; "title=" Qq20150729170553.png "alt=" Wkiom1w42j6xuyb5aadaqadkh9q886.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/82/wKiom1W42KGgs9VYAAF1sTaMEXM977.jpg "style=" float: none; "title=" Qq20150729170637.png "alt=" Wkiom1w42kggs9vyaaf1stamexm977.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/7F/wKioL1W42pKjT3NYAAE1Zh_pgD0403.jpg "style=" float: none; "title=" Qq20150729170745.png "alt=" Wkiol1w42pkjt3nyaae1zh_pgd0403.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/82/wKiom1W42K-C8ZQdAAKG3hjPyog273.jpg "style=" float: none; "title=" Qq20150729170915.png "alt=" Wkiom1w42k-c8zqdaakg3hjpyog273.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/7F/wKioL1W42p_AfsdlAADlUPqmsaY158.jpg "style=" float: none; "title=" Qq20150729171034.png "alt=" Wkiol1w42p_afsdlaadlupqmsay158.jpg "/>

Save after configuration is complete

Go to the root directory to view or modify the Ks.cfg file

[Email protected] ~]# vim ks.cfg


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W43QTDOzL4AAGFeWvgjZI093.jpg "title=" 2015-07-29_215157.png "alt=" Wkiol1w43qtdozl4aagfewvgjzi093.jpg "/>

KS.CFG indicates the location of the installation tree for the pre-installation system

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/82/wKiom1W42YPyJ37qAAEyjSpDYQs858.jpg "title=" Qq20150729171800.png "alt=" Wkiom1w42ypyj37qaaeyjspdyqs858.jpg "/>


Copy the ks.cfg to the FTP primary site Directory

[email protected] ~]# CP ks.cfg/var/ftp/

2. Create installation tree (various applications of installation system)

For the sake of simplicity I mount the disc to the Ftp/pub directory using the installation tree on the system CD

[Email protected] ~]# mount/dev/cdrom/var/ftp/pub/

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/70/7F/wKioL1W43ejCS8_IAAKq0zJdL0Q978.jpg "title=" 2015-07-29_215606.png "alt=" Wkiol1w43ejcs8_iaakq0zjdl0q978.jpg "/>

This creates the installation tree

Server-side basic configuration is complete, the following can create a new virtual machine for installation testing

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/70/82/wKiom1W43FShRoHsAAEQuoBtBKg762.jpg "title=" 2015-07-29_174342.png "alt=" Wkiom1w43fshrohsaaequobtbkg762.jpg "/>

Because the DHCP server is already configured, the virtual machine can be switched off.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/7F/wKioL1W43leRZbIrAADrYbcjqxo378.jpg "style=" float: none; "title=" Qq20150729173944.png "alt=" Wkiol1w43lerzbiraadrybcjqxo378.jpg "/>

Set Startup mode

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/82/wKiom1W43MewVZoNAAIpUGWEZ_M822.jpg "title=" 2015-07-29_174524.png "alt=" Wkiom1w43mewvzonaaipugwez_m822.jpg "/>

Select a network to boot

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/82/wKiom1W43GqRmJw6AAIi0z84O3Q851.jpg "style=" float: none; "title=" Qq20150729175021.png "alt=" Wkiom1w43gqrmjw6aaii0z84o3q851.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W43lvhl8WcAAH1tGlDAUg111.jpg "style=" float: none; "title=" Qq20150729175055.png "alt=" Wkiol1w43lvhl8wcaah1tgldaug111.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/7F/wKioL1W43lvjmezOAAEkhWIZumI107.jpg "style=" float: none; "title=" Qq20150729175252.png "alt=" Wkiol1w43lvjmezoaaekhwizumi107.jpg "/>

As you can see, the system is being installed and the experiment is successful.



There are also small problems:

After the installation of the hostname is the same, in order to enable each host can have their own host name, which can be added in the Ks.cfg file shell script, to control the name of each machine is unique, you can also create Ks.cfg file is, add in.

Script content:




Other cases can refer to http://www.cnblogs.com/mchina/p/centos-pxe-kickstart-auto-install-os.html





















This article is from the "Supervisory Authority" blog, please be sure to keep this source http://shuoshuo234.blog.51cto.com/10531943/1679816

Pxe+kickstart implementation of network-based unattended installation operating 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.