当前位置:网站首页>PXE principles and concepts
PXE principles and concepts
2022-07-26 08:41:00 【a_ b_ e_ l_】
Pxe Principles and concepts
PXE Strictly speaking, it is not an installation method , It's a way of guiding . Conduct PXE The necessary condition for installation is that the computer to be installed contains a PXE Supported network cards (NIC), That is, there must be PXE Client.PXE (Pre-boot Execution Environment) The protocol enables the computer to start over the network . The agreement is divided into client and server End ,PXE client On the network card ROM in , When the computer boots ,BIOS hold PXE client Call in memory to execute , from PXE client Download the files placed at the remote end to run locally through the network . function PXE The protocol needs to be set DHCP The server and TFTP The server .DHCP The server is used for PXE client( take The host on which the system is to be installed ) Allocate one IP Address , Because it's for PXE client Distribute IP Address , So in configuration DHCP service It is necessary to increase the corresponding PXE Set up . Besides , stay PXE client Of ROM in , It already exists TFTP Client.PXE Client adopt TFTP The agreement reached TFTP Server Download the required files .
advantage : scale : Set up multiple servers at the same time ;
automation : Install the system 、 Configure various services ;
Remote implementation : You don't need a CD 、U Disk and other installation media .
Prerequisite
The client's network card supports PXE agreement ( Integrate BOOTROM chip ), And the motherboard supports network boot . Ø There's one on the Internet DHCP Server to automatically assign addresses to clients 、 Specify the boot file location . Ø Server pass TFTP(Trivial File Transfer Protocol, Simple file transfer protocol ) Download the boot image file . among , The first condition is actually the hardware requirements , At present, most servers and most PC Can provide this support , Just in BIOS Setting allows you to set from Network or LAN Start it up .vlan: Virtual LAN
Ideas :
1、dhcp Distribute IP
2、ftp (tftp vsftp )tftp : Download the boot image file vsftp: System installation files Customized boot mode pxelinux.cfg/default ——》 How to guide Define kernel boot 、 safe mode 、 test
3、 Image file
4、 Nobody is on duty kickstart service
Kickstart Concept
KickStart It's a kind of unattended installation .KickStart The working principle of is to record the manual work required in the typical installation process Pre filled parameters , And generate a file named ks.cfg The file of ; During the subsequent installation ( It's not just about generating KickStart Ann A machine for loading documents ) When a parameter is required to be filled , Setup will first find KickStart Generated files , When you find a match When appropriate parameters , Just use the parameters found , When no suitable parameter is found , It requires manual intervention by the installer . such , If KickStart The file covers all the parameters that need to be filled in during installation , The installer can just tell Where to get the installer ks.cfg file , Then go and do your own thing . After installation , The installation program will follow ks.cfg Reset set in Enable the option to restart the system , And end the installation .
Pxe working process
1.PXE The client sends DHCP request , towards DHCP Server application IP Address .
2.DHCP Server response PXE Client requests , Automatically from IP Allocate an address in the address pool IP Address to PXE The client , And tell PXE The client :TFTP Server's IP Address and PXE Bootloader file pxelinux.0, Default in TFTP share directory /var/lib/tftpboot/ Next
3.PXE The client is going to TFTP The server initiates the acquisition pxelinux.0 Request for bootstrap file .
4.TFTP Server response PXE Client requests , Share it pxelinux.0 File transfer to PXE The client .5.PXE The client starts to the main interface of system installation through the network .
6.PXE Client to file sharing server (“ftp”、http、nfs etc. ) Initiate acquisition centos or windows Request for system installation files .
7.(vsftp) File sharing service response PXE Client requests , Transfer the shared system installation files to PXE The client .8.PXE The client enters the installation prompt wizard interface , Users need to manually complete the operation of system installation
Pxe build
1. Install and enable DHCP service
yum -y install dhcpcp -rfp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
Here you need to reset a network card
Here, set the newly added network card to host only mode , Use local vmnet1 network card , Then observe the address segment of this network card
Local here vmnet1 NIC ip Address set to 192.168.31.2, As dhcp Gateway to service .
Make the following settings in the configuration file :
vim /etc/dhcp/dhcpd.conf
systemctl start dhcpd
systemctl enable dhcpd
2、 Install and enable TFTP service
TFTP:(Trivial File Transfer Protocol) Is a small and easy to implement file transfer protocol .TFTP Is based on UDP The datagram , We need to have our own corrective measures .TFTP Only file transfer is supported , No interaction supported , There is no huge command set . There is no directory list function , And the inability to authenticate users . But its code takes up less memory , You don't need a hard disk to cure TFTP Code , Very suitable for smaller computers and special-purpose equipment .
TFTP and FTP One major difference is that it has no interactive , Without authentication .
TFTP Generally used to transfer small files
yum -y install tftp-server
yum -y install xinetd
vim /etc/xinetd.d/tftp //tftp By xinet Escrow ,xinetd Not installed by default , The configuration file
xinetd namely extended internet daemon,xinetd Is a new generation of network daemons Services , It's also called super Internet The server . Often used to manage a variety of lightweight Internet service .xinetd Offer something similar to inetd+tcp_wrapper The function of , But stronger and safer
disable Set up no
be used for PXE Network installed Linux kernel 、 Driver files can be downloaded from CentOS 7 System CD / Image acquisition , Respectively vmlinuz and initrd.img, Located in the CD Directory images/pxeboot Next . Find these two files and copy them to tftp The root directory of the service
vmlinuz It's steerable 、 Compressed kernel .“vm” representative “Virtual Memory”.Linux Support virtual memory , It's not like the old operating system, like DOS Yes 640KB Memory limit .Linux Ability to use hard disk space as virtual memory , Hence the name “vm”.vmlinuz It's executable Linux kernel , It is located in /boot/vmlinuz, It is usually a soft link .
initrd yes “initial ramdisk” Abbreviation ( System initialization file ). initrd It is usually used to temporarily boot hardware to the actual kernel vmlinuz The state of being able to take over and continue to guide .initrd.img It is mainly used to load ext4 And other file systems scsi Device drivers . such as , It uses scsi Hard disk , And the kernel vmlinuz There is no such thing in the scsi Hardware driver dynamic , Then load scsi Module before , The kernel cannot load the root file system , but scsi Modules are stored in the root file system /lib/modules Next . To solve this problem , You can boot a that can read the actual kernel initrd Kernel and use initrd correct scsi Guide questions .
# Get ready tftp Files that need to be shared
mount /dev/cdrom /mnt
cd /mnt/images/pxeboot/ # Kernel files The kernel initializes the image file /var/lib/tftpboot/ Site
cp initrd.img vmlinuz /var/lib/tftpboot/
systemctl start xinetd
systemctl enable xinetd
systemctl start tftp
systemctl enable tftp
The above is to convert the kernel file in the image + System initialization file Throw it tftp In the default shared directory , In order to follow up pxe-client To download
3、 Get ready PXE Bootstrap pxelinux.0
pxelinux.0 It's a binary , The main function is equivalent to the guidance of a system installation step , Guide the client how to install the system
yum provides */pxelinux.0 // Find out which package this file is installed by , Use when not a path and a package /
Yum install -y syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ # copy to tftp Under the root directory of , System boot file
4. Configure the Startup menu file
The Startup menu is used to guide the boot process of the client , Including how to call the kernel , How to load drivers . The default Startup menu file is default, Should be placed in tftp Root directory pxelinux.cfg subdirectory , The typical Startup menu configuration can be established automatically or manually by referring to the following operations . As for why /var/lib/tftpboot/pxelinux.cfg/default file , Because it was pxelinux.0 This document determines the good
mkdir /var/lib/tftpboot/pxelinux.cfg // Default pxelinux.cfg There is no need to manually create , Note that it is a directory, not a directory .cfg ending
Purely manual configuration default Menu file vim /var/lib/tftpboot/pxelinux.cfg/default
5. install ftp service , Get ready centos Install source
yum -y install vsftpd
mount /dev/cdrom /mnt
mkdir /var/ftp/centos7
cp -rf /mnt/* /var/ftp/centos7 # Copy the image into it
systemctl start vsftpd
6. Set the boot installer
part / --fstype="xfs" --grow --size=1 // Partition configuration
part swap --fstype="swap" --size=2048
part /boot --fstype="xfs" --size=17000
Here you can give parameters such as boot Partition ,/ Partition ,swap The division unit is MB
minimal installation
%packages
@base // Install the base package
@^gnome-desktop-environment // Install desktop environment
%end
If you need to configure the software package yourself , You need to edit ks.cfg file vim ks.cfg Add to last
%packages
@^graphical-server-environment
@base
@core
@desktop-debugging
@development
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@hardware-monitoring
@input-methods
@internet-browser
@multimedia
@print-client
@x11 chrony
%end
7. add to ks To optimize
vi /var/lib/tftpboot/pxelinux.cfg/default
default auto
prompt 0
label auto kernel vmlinuz append initrd=initrd.img method=ftp://192.168.100.100/centos7 ks=ftp://192.168.31.1/ks.cfg
label linux text kernel vmlinuz append text initrd=initrd.img method=ftp://192.168.31.1/centos7 ks=ftp://192.168.31.1/ks.cfg
label linux rescue kernel vmlinuz append rescue initrd=initrd.img method=ftp://192.168.31.1/centos7 ks=ftp://192.168.31.1/ks.cfg
8. Graphical interface guide configuration
system-config-kickstart
Enter the above command in the virtual machine to open the configuration interface
边栏推荐
- 【FreeSwitch开发实践】使用SIP客户端Yate连接FreeSwitch进行VoIP通话
- NLP (natural language processing) natural language processing learning
- Nodejs2day(nodejs的模块化,npm下载包,模块加载机制)
- MySQL 8.0 OCP (1z0-908) has a Chinese exam
- Huffman transformation software based on C language
- Flutter text is left aligned with no blank space in the middle
- 03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
- 内存管理-动态分区分配方式模拟
- Web3 Games: current situation and future
- [recommended collection] summary of MySQL 30000 word essence - partitions, tables, databases and master-slave replication (V)
猜你喜欢
【FreeSwitch开发实践】自定义模块创建与使用
Kotlin variables and constants
In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience
Mysql8 one master one slave +mycat2 read write separation
03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
基于C语言的内存管理-动态分区分配方式模拟
Memory management based on C language - Simulation of dynamic partition allocation
2022-7-8 personal qualifying 5 competition experience (supplementary)
基于C语言设计的换乘指南打印系统
[freeswitch development practice] user defined module creation and use
随机推荐
2022 national vocational college skills competition "network security" competition question file upload penetration test answer flag
【搜索专题】看完必会的搜索问题之洪水覆盖
Arbitrum launched the anytrust chain to meet the diverse needs of ecological projects
Seq2seq and attention model learning notes
03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
Shell programming
MySQL 8.0 OCP (1z0-908) has a Chinese exam
QT note 2
If Yi Lijing spits about programmers
Special lecture 2 dynamic planning learning experience (should be updated for a long time)
解决C#跨线程调用窗体控件的问题
12306 ticket system crawling - 1. Saving and reading of city code data
基于C语言实现的人机交互软件
Kotlin属性与字段
【FreeSwitch开发实践】自定义模块创建与使用
The full name of flitter IDFA is identity for advertisers, that is, advertising identifiers. It is used to mark users. At present, it is most widely used for advertising, personalized recommendation,
23.5 event listeners of application events and listeners
Oracle 19C OCP 1z0-082 certification examination question bank (13-18)
Flutter compilation fails
Memory management - dynamic partition allocation simulation