PXE efficient batch installation and Kickstart unattended installation-truly complete batch automatic installation
- 1. Overview of PXE
- 2. Advantages of PXE
- Third, the premise of building PXE
- Fourth, deploy PXE remote installation service
-
- 1. Install TFTP service
- 2. Modify the configuration file of the TFTP service and start the service
- 3. Install DHCP service
- 4. Modify the configuration file of the DHCP service and start the service
- 5. Prepare the Linux kernel and initialize the image file
- 6. Prepare the PXE boot program
- 7. Install FTP service and prepare CentOS 7 installation source
- 8. Configure the boot menu file (the default file name is default, located in the pxelinux.cfg subdirectory of the TFTP root directory)
- 9. Turn off the firewall and verify the PXE network installation
- Five, realize Kickstart unattended installation
1. Overview of PXE
- PXE (Pre-Boot Execution Environment) is a network boot technology developed by Inter Corporation. It works in Client/Server mode, allowing clients to download boot images from remote servers via the network, and load installation files or the entire operating system.
2. Advantages of PXE
-
Scale: install multiple servers at the same time
-
Automation: install the system, configure various services
-
Remote realization: no CD, U disk and other installation media are required
Third, the premise of building PXE
-
The client's network card must support the PXE protocol (integrated BOOTROM chip), and the motherboard supports network boot. Generally, most servers support it. You only need to allow booting from Network or LAN in the BIOS settings.
-
There is a DHCP server in the network to automatically assign addresses to clients and specify the location of the boot file.
-
The server must provide the download of the boot image file through the TFTP service (Simple File Transfer Protocol).
Fourth, deploy PXE remote installation service
-
PXE remote installation server integrates CentOS7 installation source , TFTP service , DHCP service , and can send PXE boot program, Linux kernel, boot menu and other data to the client bare metal, as well as provide installation files.
-
TFTP (Trivial File Transfer Protocol) is a UDP-based protocol for simple file transfer between client and server, suitable for small file transfer applications. The TFTP service is managed by the xinetd service by default, using UDP port 69 .
-
xinetd is a new generation of network daemon service program, also called super server, commonly used to manage a variety of lightweight Internet services.
1. Install TFTP service
2. Modify the configuration file of the TFTP service and start the service
3. Install DHCP service
4. Modify the configuration file of the DHCP service and start the service
5. Prepare the Linux kernel and initialize the image file
6. Prepare the PXE boot program
7. Install FTP service and prepare CentOS 7 installation source
8. Configure the boot menu file (the default file name is default, located in the pxelinux.cfg subdirectory of the TFTP root directory)
9. Turn off the firewall and verify the PXE network installation
-
Use a virtual machine created by VMware for testing. The memory of the virtual machine must be at least 2GB, otherwise an error may be reported when the installation is started.
-
Turn on the virtual machine, press Enter directly after the prompt string "boot:" (or execute the "auto" command), the installation file will be automatically downloaded via the network and enter the default graphical installation portal
-
If you execute the "linux text" command, you will enter the text installation entry; if you execute the "linux rescue" command, you will enter the rescue mode.
Five, realize Kickstart unattended installation
1. Prepare to install the answer file
①, install the system-config-Kickstart tool
②. Open the "Kickstart Configuration Program" window
③, configure Kickstart options
④, save the automatic response file
⑤, configure the software package that needs to be installed
如要求最小化安装,可复制下面内容:
vim ks.cfg
%packages
@^minimal
%end
⑥. Edit the boot menu file default and add ks boot parameters
2. Verify unattended installation
When the client computer boots in PXE mode every time, it will automatically download the ks.cfg answer file, and then install the CentOS 7 system according to the settings in it, without manual intervention.