Linux Beginner-PXE Installation article

Source: Internet
Author: User

Linux Beginner-pxe installation article

The PXE network machine is the client that starts from its own network card, requests the IP from the DHCP server in the network, and requests the boot file from the TFTP server of the network. This installation requires Kickstart, TFTP, DHCP, syslinux and other services. The following describes how to automate the PXE installation. The parameter settings in this article are based on native parameters, and different hosts may require different parameters.

1, Kickstart

"Yum install System-config-kickstart" Download kickstart software, and enter "System-config-kickstart", the following interface appears, the software can pre-answer the installation process password, partition, Memory size and other issues, read this file, so that the machine can be completed automatically. The step picture is below the text.

Enter "Root Passwd" in the option contents of the blue bar and re-enter the root user password in the "Confirm Password", at the bottom "Reboot system after Installation" and "Perform Installation in text mode "before the tick.

In the option to the right of this blue bar, select "Perform New Installation" At the top, select "http" in "Installation Source" below and enter "172.25.254.2" in "http Server" in the " Enter "/rhel7.2" in HTTP Directory. That is, the ISO image file under the HTTP Mount address, its Mount method has been introduced in the Software Management chapter.

In the option to the right of this blue bar, select Install new boot loader in the top "Install Type" option box.

In the option to the right of this blue bar, click "Add" at the bottom, and then add the partition "/boot", "swap", and "/" in turn.

In the option to the right of this blue bar, click "Add Network Device" to enter "Eth0" and click "OK" to add.

This blue bar option can be ignored.

In the option to the right of this blue bar, change "Active" under "SElinux" to "Disabled".

This blue bar option can be ignored.

This blue bar option can be ignored. The preinstalled software cannot be selected because of a software issue.

This blue bar option can be ignored.

This blue bar option can be ignored. You can also enter the commands that you need to perform after the installation is completed in the bottom right box.

Click "Save" under "File" in the upper left corner to save the file with the file name Ks.cfg. This article is saved under the current desktop. "Vim/home/kiosk/desktop/ks.cfg" writes this file, entering the content shown at the bottom, which is a pre-installed selection of software not included in the above. When finished, enter "Svalidator ks.cfg". The file is moved to the "/var/www/hmtl/" directory, and the automatic answer file configuration is completed at the time of installation.

2. TFTP syslinux

"Yum Install Tftp-server" installs the TFTP service. "Yum Install Syslinux" installs Syslinux. After the installation is complete, enter "cp/var/www/html/rhel7.2/isolinux/*/var/lib/tftpboot/" to copy all the files in the "Isolinux" directory to the "Tftpboot" directory. Then enter "cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/" and copy the "pxelinux.0" file to the "Tftpboot" directory. As shown in.

"Mkdir/var/lib/tftpboot/pxelinux.cfg" creates a "pxelinux.cfg" directory under the "Tftpboot" directory. Enter "Cp/var/lib/tftpboot/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default" to copy "isolinux.cfg" file to Directory "Pxelinux.cfg" Under the "Default" file:

"Systemctl start Tftp.service" To open the TFTP service, "Systemctl enable Tftp.service" Set the boot start, this TFTP configuration is complete.

3. DHCP

"Yum Install DHCP" installs the DHCPD service. After the installation is complete, enter "Head-n 36/usr/share/doc/dhcp-4.2.5/dhcpd.conf.example >>/etc/dhcp/dhcpd.conf" to "Dhcpd.conf.example" The first 36 lines of the file are entered in the "dhcp.conf" file.

"Vim/etc/dhcp/dhcp.conf" makes the following modifications to this file:

Change the "example.org" in line 7th to "example.com".

Change "ns1.example.org, ns2.example.org" in line 8th to "172.25.254.250".

In the 27th, enter "#" before line 28 to comment out the two lines.

Change "10.254.239.0" after "subnet" in line 32nd to "172.25.254.0" and Change "255.255.255.224" after "netmask" to "255.255.255.0".

Change line 33rd "10.254.239.10 10.254.239.20" to "172.25.254.80 172.25.254.90".

Change line 34th "rtr-239-0-1.example.org, rtr-239-0-2.example.org" to "172.25.254.250".

Delete "}" in line 35th and enter "Next-server 172.25.254.2;". In line 36th, enter the filename "pxelinux.0;". And finally Add "}".

After exiting save, enter "Systemctl start Dhcpd.service" to start the DHCPD service. This completes the configuration of DHCP.

4, the default file configuration when installed

The "default" file under the "/var/lib/tftpboot/pxelinux.cfg" directory is the default profile for reading information when the NIC is started, as shown in.

The 2nd line of "Timeout" can set the wait time, the value is usually the number of seconds multiplied by 10, for example, instead of "30", that is, the wait time is 3 seconds.

Place the "menu default" on line 68th to line 63rd. , and change the "inst.stage2=hd:label=rhel-7.2\x20server.x86_64" of line 65 to "repo=http://172.25.254.2/rhel7.2 ks=http:// 172.25.254.2/ks.cfg "input": wq! " Forces the save to exit.

After you set up the above settings, you can set up a host to boot from the network, and then install it automatically. Experiments are typically performed in virtual machines. The steps are shown below.

Enter "Virt-manager" to open the virtual machine management device.

After selecting the virtual machine, click "Open", click the light bulb button in the upper left corner and enter the virtual machine configuration.

Select "Boot Options", select "NIC" in the dialog on the right, and use the arrows to move this option to the first row, and click "Apply" in the lower-left corner.

Click the Triangle Start button next to the Lamp button to complete the automatic installation.

Linux Beginner-PXE Installation article

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.