PXE unattended installation**
Experiment 1: Network installation pxe
one. Install httpd, tftp, dhcp, syslinux
1. Mount the CD
2. Build a warehouse
3. Modify the main configuration file of the http service
4. Restart the http service
[root@xss yum.repos.d]# service httpd restart
5. Clear & update yum cache
[root@xss yum.repos.d]# yum clean all //Clear the original yum cache
[root@xss yum.repos.d]# yum makecache //Update yum cache
6. Install tftp, dhcp, syslinux services
[root@xss yum.repos.d]# yum -y install tftp-server dhcp syslinux
two. Enable tftp service, provide kernel, initialization image file, boot program
kernel vmlinuz, initialization image initrd.img, boot program file pxelinux.0
1. Modify the tftp default configuration file
2. Start the xinetd service
[root@xss Packages]# service xinetd start
3. Prepare initialization image file and kernel
Access the /cdrom/images/pxeboot/ folder, and copy the kernel file and initialization image in the image used to install the system to the shared directory /var/lib/tftpboot/ of the tftp server [root@xss pxeboot]# cp
vmlinuz initrd.img /var/lib/tftpboot/
4. Prepare the boot program file
[root@xss syslinux]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
3. Configure dhcp, and point out the location of the bootloader
1. Modify the dhcp configuration file
subnet 192.168.43.0 netmask 255.255.255.0 {
range 192.168.43.10 192.168.43.200;
option subnet-mask 255.255.255.0;
ddns-update-style none;
default-lease-time 259200;
max-lease-time 518400;
option routers 192.168.43.1;
option broadcast-address 192.168.43.255;
option domain-name-servers 114.114.114.114;
next-server 192.168.43.227;
filename “pxelinux.0”;
}
Next-server is used to specify the IP of the TFTP server, that is, the local IP
filename points to the boot program file (pxelinux.0) in the TFTP shared directory (/var/lib/tftpboot)
2. Check whether the dhcp configuration file is correct and start the dhcp service
[root@xss tftpboot]# service dhcpd configtest
[root@xss tftpboot]# service dhcpd start
IV. Create a boot menu file and configure the boot menu
1. Create the boot menu file
2. Configure the boot menu
[root@xss pxelinux.cfg]# vim /var/lib/tftpboot/pxelinux.cfg/default
default auto
prompt 1
label auto
kernel vmlinuz
append initrd=initrd.img devfs=nomount ramdisk_size=8192
label linux text
kernel vmlinuz
append text initrd=initrd.img devfs=nomount ramdisk_size=8192
label linux rescue
kernel vmlinuz
append rescue initrd=initrd.img devfs=nomount ramdisk_size=8192
5. Restart various services
[root@xss html]# service httpd restart
[root@xss html]# service xinetd restart
[root@xss html]# service dhcpd restart
six. Create a new virtual machine for testing
Note: The network connection mode of the newly created virtual machine must be consistent with the server