Table of contents- 1. Preparation
- 1. Prepare the environment
- 2. Installation method
- 3. Network card configuration
- 2. Installation Phase
- 1. Install httpd
- 2. Install tftp-server
- 3. Copy the pxe file
- 4. Install DHCP service
- 3. Install the kickstart automatic installation tool
- 4. Test on the client host
- V. Related Services
1. Preparation 1. Prepare the environment Vmware workstation Centos7 as pxe-server Address:192.168.138.5 Subnet mask: 255.255.255.0 Gateway: 192.168.138.2 Disable selinux and firewall 2. Installation method Kickstart installation. Kickstart is an unattended installation method. Its working principle is to record various parameters that typically require manual intervention during the installation process and generate a file named ks.cfg. The installation program will first look for the file generated by Kickstart. If it finds suitable parameters, it will adopt these parameters. The installation program will restart the system according to the settings in ks.cfg and end the installation. 3. Network card configuration Select hostonly mode for the network card and cancel the DHCP function in hostonly mode. 
2. Installation Phase Because the system-config-kickstart tool will be used later to generate the ks file, it must rely on X Windows, so we have to install the desktop environment in advance. yum -y groupinstall 'X Window System' yum -y groupinstall 'GNOME Desktop Environment'
1. Install httpd An http environment is required to store system image files and ks files, so install http first yum install httpd Systemctl start httpd Visit http://192.168.138.5

Configure yum mount /dev/cdrom /mnt cd /mnt
2. Install tftp-server
yum -y install tftp-server
Modify /etc/xinetd.d/tftp and change the value of disable from yes to no 
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
} Restart the xinetd process. If there is no xinetd, you need to install it with yum. systemctl restart xinetd.service
Create a new tftpboot folder mkdir -p /var/lib/tftpboot
3. Copy the pxe file Install syslinux and copy the pxelinux.0 file to /var/lib/tftpboot cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
Create /var/www/html/cdrom and mount it Mount /dev/cdrom /var/www/html/cdrom
Yum source configuration 
Copy initrd.img and vmlinuxz on the CD to /var/lib/tftpboot
cp /var/www/html/cdrom/images/pxeboot/initrd.img /var/lib/tftpboot cp /var/www/html/cdrom/images/pxeboot/vmlinuz /var/lib/tftpboot cp /var/www/html/cdrom/isolinux/boot.msg /var/lib/tftpboot
Create a new pxelinux.cfg directory in tftpboot
mkdir pxelinux.cfg
Copy the isolinux.cfg in the cdrom directory to the pxelinux.cfg directory and change the file name to default cp /var/www/html/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default Edit the default file configuration as follows default vesamenu.c32 timeout 6000 display boot.msg #Clear the screen when exiting the menu, instead of leaving the menu displayed. #For vesamenu, this means the graphical background is still displayed without #the menu itself for as long as the screen remains in graphics mode. menu clear menu background splash.png menu title CentOS 7 menu vshift 8 menu rows 18 menu margin 8 #menu hidden menu helpmsgrow 15 menu tabmsgrow 13 #Border Area menu color border * #00000000 #00000000 none #Selected item menu color sel 0 #ffffffff #00000000 none #Title bar menu color title 0 #ff7ba3d0 #00000000 none #Press [Tab] message menu color tabmsg 0 #ff3a6496 #00000000 none #Unselected menu item menu color unsel 0 #84b8ffff #00000000 none #Selected hotkey menu color hotsel 0 #84b8ffff #00000000 non #Unselected hotkey menu color hotkey 0 #ffffffff #00000000 none #Help text menu color help 0 #ffffffff #00000000 none #A scrollbar of some type? Not sure. menu color scrollbar 0 #ffffffff #ff355594 none #Timeout msg menu color timeout 0 #ffffffff #00000000 none menu color timeout_msg 0 #ffffffff #00000000 none #Command prompt text menu color cmdmark 0 #84b8ffff #00000000 none menu color cmdline 0 #ffffffff #00000000 none #Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. menu tabmsg Press Tab for full configuration options on menu items. menu separator # insert an empty line menu separator # insert an empty line label linux menu label ^Install CentOS 7 kernel vmlinuz #append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet append initrd=initrd.img repo=http://192.168.138.5/cdrom ks=http://192.168.138.5/ks.cfg label check menu label Test this ^media & install CentOS 7 menu default kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet menu separator # insert an empty line #utilities submenu menu begin ^Troubleshooting menu title Troubleshooting label vesa menu indent count 5 menu label Install CentOS 7 in ^basic graphics mode text help Try this option out if you're having trouble installing CentOS 7. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet default cdrom prompt 0 label rescue menu indent count 5 menu label ^Rescue a CentOS system text help If the system will not boot, this lets you access files and edit config files to try to get it booting again. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet label memtest menu label Run a ^memory test text help If your system is having issues, a problem with your system's memory may be the cause. Use this utility to see if the memory is working correctly. endtext kernel memtest label cdrom kernel vmlinuz append initrd=initrd.img ks=http://192.168.138.5/ks.cfg devfs=nomount menu separator # insert an empty line label local menu label Boot from ^local drive localboot 0xffff menu separator # insert an empty line menu separator # insert an empty line label returntomain menu label Return to ^main menu menu exit menu end
Restart the httpd service cp /var/www/html/cdrom/isolinux/vesamenu.c32 /var/lib/tftpboot/ 4. Install DHCP service yum –y install dhcp cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
Modify dhcpd.conf 
next-server 192.168.138.5; ------------------Local address, used as the address of the ks server filename "pxelinux.0"; subnet 192.168.138.0 netmask 255.255.255.0 { range 192.168.138.10 192.168.138.50; -----------Allocated address pool option routers 192.168.138.5; option subnet-mask 255.255.255.0; option domain-name-servers 192.168.138.5; default-lease-time 86400; max-lease-time 86400; }
After configuration, start dhcp
service dhcpd start
3. Install the kickstart automatic installation tool Yum direct installation
yum -y install system-config-kickstart
Launch Kickstart in the desktop environment
system-config-kickstart



Allocate partitions based on your needs. Try to allocate more than 4G for the usr directory. 




Select the desktop version of the installation package to install the graphical version, you can choose it yourself. If this step reports an error, see the yum configuration 

The following two items can be configured by default after file–>save 
Save to this directory and view the ks.cfg file
#platform=x86, AMD64, or Intel EM64T #version=DEVEL #Install OS instead of upgrade install #Keyboard layouts keyboard 'us' #Root password rootpw --iscrypted 11PObWbosO$B09PFFThWxWujr.TANYuJ. #Use network installation url --url="http://192.168.138.5/cdrom" #System language lang en_US #System authorization information auth --useshadow --passalgo=sha512 #Use graphical install graphical firstboot --disable #SELinux configuration selinux --disabled #Firewall configuration firewall --disabled #Network information network --bootproto=dhcp --device=ens33 #Reboot after installation reboot #System timezone timezone Asia/Shanghai #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr #Partition clearing information clearpart --all --initlabel #Disk partitioning information part / --fstype="xfs" --size=10240 part /boot --fstype="xfs" --size=2048 part /home --fstype="xfs" --size=1024 part /var --fstype="xfs" --size=2048 part /tmp --fstype="xfs" --size=2048 part /usr --fstype="xfs" --size=4096 part /opt --fstype="xfs" --size=4096 part swap --fstype="swap" --size=4096 %packages @desktop-debugging @fonts @gnome-desktop @kde-desktop @legacy-x @x11 xterm %end
4. Test on the client host Create a new virtual machine, enter pxe and choose to load dhcp from the network, and then it will be automatically installed. In /var/lib/dhcpd/dhcpd.leases, you can see the IP address and other information assigned to the newly added machine 
V. Related Services systemctl start httpd systemctl enable httpd systemctl start dhcpd systemctl enable dhcpd systemctl start xinetd
You can test it yourself. If you have any questions, please feel free to consult! This concludes this article about the detailed process of using VMware to test PXE batch installation servers. For more relevant VMware testing PXE content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:- Detailed steps to install centos with vmware10.0 cracked version
- The most complete and detailed process of installing deepin20 on vmware virtual machine
- The latest virtual machine VMware 14 installation tutorial
- Detailed steps for installing and using vmware esxi6.5
- VMware15/16 Detailed steps to unlock VMware and install MacOS
- VMware, nmap, burpsuite installation tutorial
|