Based on PXE, kickstart automatically installs centos6.5 through the network

Source: Internet
Author: User
Tags file transfer protocol fully qualified domain name

PXE (preboot execute environment, pre-start execution environment) is the latest technology developed by Intel. It works in the client/server network mode and supports workstation downloading images from remote servers over the network, in addition, the operating system can be started through the network. During the startup process, the terminal requires the server to assign an IP address, and then use TFTP (Trivial File Transfer Protocol) or mtftp (Multicast Trivial File Transfer Protocol) download a startup software package to the local memory for execution. This startup Software Package completes the terminal (customer ?) Basic software settings to guide the terminal operating system that is pre-installed on the server. Next, let's use DHCP + HTTP + tftp to install centos 6.5 Through PXE.

1. Install the DHCP server so that the NIC can obtain the IP address, find the TFTP server with the installation file, and edit the configuration file of the DHCP service.

[[email protected] ~]# yum install dhcp[[email protected] ~]# rpm -q dhcpdhcp-4.1.1-38.P1.el6.centos.x86_64[[email protected] ~]# vim /etc/dhcp/dhcpd.conf

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/BF/wKiom1PYsq7Bu33lAAE64ILHm2Y284.jpg "Title =" new Microsoft Word document -567.png "alt =" wkiom1pysq7bu33laae64ilhm2y284.jpg "/>

Then we start the DHCP service and enable a virtual machine without an operating system to monitor whether the NIC can obtain the IP address.

[[Email protected] ~] # Service DHCPD start

Starting DHCPD: [OK]

Start the virtual machine and you can see that the address is obtained successfully. However, since we have not installed TFTP, the installation process cannot proceed.

Next we need to configure the TFTP service.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/C0/wKioL1PYs8nDa_RZAACGcK9cWss978.jpg "Title =" new Microsoft Word Document-787.png "alt =" wkiol1pys8nda_rzaacgck9cwss978.jpg "/>

2. We need to install the TFTP service, change disable in the/etc/xintetd. d/TFTP file to no, and then start the xinetd service,

[[email protected] ~]# yum install tftp-server tftp[[email protected] ~]# rpm -q tftp-server tftp[[email protected] ~]# rpm -q tftp-server tftptftp-server-0.49-7.el6.x86_64tftp-0.49-7.el6.x86_64

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/BF/wKiom1PYsrCADwZyAACRWfTQJqQ427.jpg "Title =" new Microsoft Word document -1047.png "alt =" wkiom1pysrcadwzyaacrwftqjqq427.jpg "/>

By viewing the port, you can see that port 69 of TFTP has been enabled.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/C0/wKioL1PYs8vS32qsAAD9uutFrs8885.jpg "Title =" new Microsoft Word document -00005.png "alt =" wkiol1pys8vs32qsaad9uutfrs8885.jpg "/>

3. Next, we need to copy the files and boot kernel files required for PXE startup to the TFTP working directory/var/lib/tftproot.

# Install the syslinux Software Package

[[email protected] tftpboot]# yum install syslinux[[email protected] tftpboot]# rpm -q syslinuxsyslinux-4.02-8.el6.x86_64[[email protected] tftpboot]# rpm -ql syslinux |grep 0$/usr/share/syslinux/gpxelinux.0/usr/share/syslinux/pxelinux.0[[email protected] tftpboot]# cp /usr/share/syslinux/pxelinux.0 ./

# Copy the boot Kernel File

[[email protected] ~]# mount /dev/cdrom /mnt/cdrom/[[email protected] ~]# cp /mnt/cdrom/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/[[email protected] ~]# mkdir /var/lib/tftpboot/pxelinux.cfg[[email protected] /]# cp /mnt/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

Now we can enter the installation interface,

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/42/BF/wKiom1PYsreAddY7AAJArIciiEg342.jpg "Title =" new Microsoft Word Document-1764.png "alt =" wkiom1pysreaddy7aajariciieg342.jpg "/>

4. Configure the yum software repository based on httpd to provide the installation source for PXE

[[Email protected]/] # rpm-Q httpd

Httpd-2.2.15-29.el6.centos.x86_64

# Yum repository provided through CD

[[Email protected]/] # Mount -- bind/mnt/CDROM/var/www/html/CDROM/

# Start the service

[[Email protected]/] # service httpd start

Starting httpd: cocould not reliably determine the server's fully qualified domain name, using localhost. localdomain for servername

[OK]

# Test whether the source can be accessed through a browser

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/C0/wKioL1PYs9OSS-YkAAGmocOn5p8884.jpg "Title =" new Microsoft Word document -2207.png "alt =" wKioL1PYs9OSS-YkAAGmocOn5p8884.jpg "/>

5. Provide the KS. cfg file

# Install system-config-kickstart

[[email protected] /]# yum install system-config-kickstart[[email protected] /]# rpm -q system-config-kickstartsystem-config-kickstart-2.8.6.5-1.el6.noarch

# Run mongom-config-kickatart through xstart to generate the KS. cfg file

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/BF/wKiom1PYsrnzGfUNAAFCmiMyzKM130.jpg "Title =" new Microsoft Word document -2444.png "alt =" wkiom1pysrnzgfunaafcmimyzkm130.jpg "/>

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/BF/wKiom1PYsr3ichUlAAFaZfSJeuM741.jpg "Title =" new Microsoft Word Document-2446.png "alt =" wkiom1pysr3ichulaafazfsjeum741.jpg "/>

# Ks. kfg file details

[[email protected] /]# cat ~/ks.cfg #platform=x86, AMD64, or Intel EM64T#version=DEVEL# Firewall configurationfirewall --disabled# Install OS instead of upgradeinstall# Use network installationurl --url="http://172.16.21.250/cdrom"# Root passwordrootpw --iscrypted $1$8kLebhx5$XaCCpB3fvBnQutl9iQW3S1# 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 # System timezonetimezone  Asia/Chongqing# Network informationnetwork  --bootproto=dhcp --device=eth0 --onboot=on# System bootloader configurationbootloader --location=mbr# Partition clearing informationclearpart --all  # Disk partitioning informationpart / --fstype="ext4" --ondisk=sda --size=8000part /boot --fstype="ext4" --ondisk=sda --size=500part swap --fstype="swap" --size=1000 %packages@chinese-support@ftp-server@internet-browser@web-server %end

6. test whether the system can be automatically installed remotely through the network

# Specify the KS file location and press enter to run

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/BF/wKiom1PYssDRageOAABQzyF92TU866.jpg "Title =" new Microsoft Word document -3548.png "alt =" wkiom1pyssdrageoaabqzyf92tu866.jpg "/>

# You can see that the system is already automatically partitioned

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/C0/wKioL1PYs9zA0KHWAAB9dTLj-_s310.jpg "Title =" new Microsoft Word Document-3565.png "alt =" wKioL1PYs9zA0KHWAAB9dTLj-_s310.jpg "/>

# Installing the software package. The yum source configuration is correct.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/BF/wKiom1PYssXzYoABAADluVFD5io829.jpg "Title =" new Microsoft Word document -3590.png "alt =" wkiom1pyssxzyoabaadluvfd5io829.jpg "/>

# System Installation Complete

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/42/BF/wKiom1PYs-iyHjWIAAD07uWhOAg648.jpg "Title =" image 1.png "alt =" wKiom1PYs-iyHjWIAAD07uWhOAg648.jpg "/>

This article from the "light" blog, please be sure to keep this source http://dddbk.blog.51cto.com/6837943/1532889

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.