Home > Operation and Maintenance > CentOS > How to automatically install the operating system on Centos8 based on PXE

How to automatically install the operating system on Centos8 based on PXE

藏色散人
Release: 2021-05-26 16:57:26
forward
3871 people have browsed it

The following tutorial column will introduce to you the automatic installation operation of Centos8 based on PXE System, I hope it will be helpful to friends in need! PXE server configurationInstall related software

dnf install -y httpd tftp-server dhcp-server syslinux-nonlinux
Copy after login

Configure dhcp

vim /etc/dhcp/dhcpd.conf
subnet 192.168.43.0 netmask 255.255.255.0 {
range 192.168.43.100 192.168.43.200;
option routers 192.168.43.2;
option domain-name "xuepeng.com";
option domain-name-servers 180.76.76.76, 114.114.114.114;
next-server 192.168.43.8;
filename "pxelinux.0";
}
Copy after login

Start immediately, start the service automatically after booting

systemctl enable --now tftp dhcpd httpd
Copy after login

Prepare related Directory mounting CD

Add three CD-ROMs in advance and put the centos6, 7, and 8 CDs respectively

mkdir -p /var/www/html/Centos/{6,7,8}/os/x86_64
mount /dev/sr0 /var/www/html/Centos/8/os/x86_64/
mount /dev/sr1 /var/www/html/Centos/6/os/x86_64/
mount /dev/sr2 /var/www/html/Centos/7/os/x86_64/
Copy after login

Move the ks file to /var/www/html/ksdir

Centos6, 7, 8 ks.cfg

mkdir /var/www/html/ksdir
mv ks{6,7,8}.cfg /var/www/html/ksdir
Copy after login

Prepare to start the related files in the /var/lib/tftpboot directory

initre.img, vmlinuz from the CD

menu.c32, pxelinux.0 from syslinux-nonlinux package
  1. ldlinux.c32, libcom32.c32, libutil.c32 from centos8 CD
  2. pxelinux.cfg Directory created by yourself

  3. /var/lib/tftpboot/pxelinux.cfg/default file content/var/lib/tftpboot/├── Centos6│   ├── initrd.img│   └── vmlinuz├── Centos7│   ├── initrd.img│   └── vmlinuz├── Centos8│   ├── initrd.img│   └── vmlinuz├── ldlinux.c32├── libcom32.c32├── libutil.c32├── menu.c32├── pxelinux.0└── pxelinux.cfg└── default
    default menu.c32
    timeout 600
    menu title PXE Auto Install Centos
    
    
    label mini 6
      menu label ^Install CentOS Mini ^6
      kernel Centos6/vmlinuz
      append initrd=Centos6/initrd.img ks=http://192.168.43.8/ksdir/ks6.cfg
    
    
    label mini 7
      menu label ^Install CentOS Mini ^7
      kernel Centos7/vmlinuz
      append initrd=Centos7/initrd.img ks=http://192.168.43.8/ksdir/ks7.cfg
    
    label mini 8
      menu label ^Install CentOS Mini ^8
      kernel Centos8/vmlinuz
      append initrd=Centos8/initrd.img ks=http://192.168.43.8/ksdir/ks8.cfg
    
    
    label manual
      menu label ^Manual Install Centos Linux 8
      kernel Centos8/vmlinuz
      append initrd=Centos8/initrd.img inst.repo=http://192.168.43.8/Centos/8/os/x86_64
    
    label rescue
      menu label ^Rescue a CentOS Linux system 8
      kernel Centos8/vmlinuz
      append initrd=Centos8/initrd.img ks=http://192.168.43.8/ksdir/ks8.cfg rescue quiet
    
    label rescue
      menu label ^Rescue a CentOS Linux system 7
      kernel Centos7/vmlinuz
      append initrd=Centos7/initrd.img ks=http://192.168.43.8/ksdir/ks7.cfg rescue quiet
    
    
    label rescue
      menu label ^Rescue a CentOS Linux system 6
      kernel Centos6/vmlinuz
      append initrd=Centos6/initrd.img ks=http://192.168.43.8/ksdir/ks6.cfg rescue quiet
    
    label local
      menu default
      menu label Boot from ^local drive
      localboot 0xffff
    Copy after login
    pxe client configuration

    Open a new one The virtual machine starts from the network card


    The system automatically installs the software packageHow to automatically install the operating system on Centos8 based on PXE
    How to automatically install the operating system on Centos8 based on PXE Enters the system

    How to automatically install the operating system on Centos8 based on PXE

    The above is the detailed content of How to automatically install the operating system on Centos8 based on PXE. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template