Installation of PXE unattended system under CENTOS7

Source: Internet
Author: User

In order to meet the installation of hundreds of Linux, and do not require manual intervention. This requires PXE to automatically install Linux via a network cable


1. Build yum source to download the necessary tools, yum the configuration of the source see click on the Open link.

2. Download Syslinux,dhcp,http,tftp-server.

[root@localhost etc]# yum-y install syslinux dhcp httpd tftp-server Loaded
plugins:fastestmirror, langpacks
Loa Ding mirror speeds from cached hostfile Package syslinux-4.05-12.el7.x86_64 already installed and
latest version
Package 12:dhcp-4.2.5-42.el7.centos.x86_64 already installed and latest version
Package Httpd-2.4.6-40.el7.centos.x86_64 already installed and latest version
Package tftp-server-5.2-12.el7.x86_64 Already installed and latest version nothing
todo

Since I was installed, I report nothing to do. If it's not installed, execute that order.

Yum-y Install syslinux DHCP httpd tftp-server


3. Download the automatic Installation Kickstart tool command

Yum-y Install System-config-kickstart

Again, I've installed it before I report nothing todo

[root@localhost ~]# yum-y install System-config-kickstart Loaded plugins:fastestmirror
, langpacks
Loading Mirror speeds from cached hostfile Package System-config-kickstart-2.9.2-4.el7.noarch already installed and
latest Version nothing
todo
4. Build an HTTP installation source.

Enter/var/www/html and create a directory CentOS to mount the mirror

[Root@localhost ~]# cd/var/www/html/
[root@localhost html]# ls
CentOS  ks.cfg
[root@localhost html]# Mount/dev/sr0/var/www/html/centos
Note: Do not have the CentOS directory to create a directory first. (That Ks.cfg first don't have to control, next step again teaches how to produce).

The order is Mkdir/var/www/html/centos. Then mount (Sr0 is mirrored, and can be written in other mirrors, and so on).

Then execute the following command

[Root@localhost html]# systemctl start httpd
[root@localhost html]# systemctl Stop Firewalld
Can be in the browser. Enter Ip/centos. You can see the image below to represent success.




5. Use the System-config-kickstart tool to generate an automatic installed configuration file

Run the command and pop up a graphical interface

[Root@localhost ~]# System-config-kickstart 
Fill in the following graphic



The second: Installation method (this Ip,http directory to fill out your own CD-ROM image of the catalog)


The third one. Boot Loader Options


Fourth one. Partition Information


Partition your own Operation bar. Point below the Add (that 1 represents the remaining disk)


Fifth Network Configuration


Sixth (I don't want to change the option)


Seventh One


Save it, (because CentOS7 under this software problem.) Also need to edit the ks.cfg in vim this file)

Open this ks.cfg this file. At the back, add

%packages

@base

%end

After saving. Use the following command to check for grammatical errors

[Root@localhost ~]# Ksvalidator ks.cfg 

Move the file to/var/www/html/ks.cfg

[root@localhost html]# ls
CentOS  ks.cfg
[root@localhost html]# pwd-/var/www/html
Restart the network service again.

[root@localhost html]# systemctl Restart httpd
If you can see the following in the browser, prove the above process is good (this time I use the Firefox browser.) Don't care about the details. )



6. Configure TFTP (this file is located in the lower left corner)


Then execute the command.

[Root@localhost ~]# systemctl start xinetd


7. Placing the necessary documents in the Tftpboot

[Root@localhost ~]# cp/usr/share/syslinux/pxelinux.0  /var/lib/tftpboot/
[Root@localhost ~]# Mkdir/var/lib/tftpboot/pxelinux.cfg
Isolinux everything under the mirror to Tftpboot.

[Root@localhost centos]# cp/var/www/html/centos/isolinux/*  /var/lib/tftpboot/
And then the isolinux.cfg to pxelinux.cfg under the name default

[Root@localhost centos]# Cp/var/lib/tftpboot/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default 

8. Configure the DHCP server

Edit the dhcpd.conf file under/etc/dhcp

This file is written below


Option Domain-name "example.org";
Option Domain-name-servers 114.114.114.114;

Default-lease-time 6000;
Max-lease-time 72000;

Log-facility Local7;

Subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.10 192.168.1.200;
  option routers 192.168.1.1;
  FileName "pxelinux.0";
  Next-server 192.168.1.192;
}


Attention:




All right. The last step. Modify the file. This file is/var/lib/tftpboot/pxelinux.cfg/default.

(There is the 63 line plus menu default, delete the 69 line menu default)





At last. Restart the service ... (Firewall off)

<span style= "FONT-SIZE:18PX;" pxelinux.cfg]# systemctl Restart httpd [root@localhost pxelinux.cfg]# systemctl restart >[root@localhost xinetd
[root@localhost pxelinux.cfg]# systemctl Restart DHCPD
[Root@localhost pxelinux.cfg]# systemctl stop Firewalld
</span>


To. Try the effect with VMware

1. Create a new virtual machine


2. Choose to install the operating system later


3. The future is random point. According to their own preferences

4. Stop here for a moment.



Upon completion. Automatic installation of virtual machines, no manual ...







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.