Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install RHEL7 operating system in PXE+kickstart

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to install the RHEL7 operating system PXE+kickstart, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

PXE (preboot execute environment, pre-boot execution environment) is the latest technology developed by Intel, which works in the network mode of Client/Server. It supports workstations to download images from remote servers through the network, and thus supports booting the operating system through the network. During the startup process, the terminal requires the server to assign an IP address. Then use TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file transfer protocol) protocol to download a startup package into local memory for execution, and the startup package completes the terminal basic software settings, thus booting the terminal operating system pre-installed in the server. PXE can boot a variety of operating systems, such as Windows95/98/2000/windows2003/windows2008/win7/win8,linux.

Kickstart is the automatic installation system function provided by Red Hat. Red Hat system installer Anaconda needs to know how to install the system, such as how to partition the disk, how to configure the network interface, how to choose the software package to install and so on. This is an interactive process. The text file provided by kickstart contains all the answers that the Anaconda system installer needs to know when it runs, thus eliminating the interaction when installing the system.

The combination of pxe and kickstart can realize completely unattended installation of the system. After the client power-up is started by NIC, it is obtained from the dhcpd server (three related configurations in dhcpd service configuration file / etc/dhcpd/dhcpd.conf).

IP

Boot file pxelinux.0 (the default boot file name pxelinux.0 is found in the tftp root directory / var/lib/tftpboot/ by default, the pxelinux.0 file is in the syslinux installation package, and the pxelinux.0 is generated in the / usr/share/syslinux/ directory after installing syslinux)

Tftp address.

After the client gets three related information, download vmlinuz (microsystem kernel basic process file) and initrd.img (driver file) through the TFTP address (default tftp boot configuration file / var/lib/tftpboot/pxelinux.cfg/default), and boot the Red Hat installer Anaconda to start. Anaconda reads the basic setting information when setting up the installation system in the kickstart response file and the installation package publisher server address (nfs,httpd,ftp,cdrom) that needs to be found when installing the system, and completes the unattended installation of the operating system.

In this article, the machine running the pxe + kickstart service is defined as the server, and the machine on which the operating system is to be installed is defined as the client. The detailed steps are as follows:

1. PXE service configuration

PXE service consists of DHCPD server and TFTP server. Dpchd service and tftp service can run on one server or split two servers.

1.1 DHCPD Services

Provide the client with the necessary network information, such as IP, netmask, gateway, dns, etc., and provide the location of the boot file (pxelinux.0) and the address of the TFTP server to the client. The IP of this article server is 192.168.56.14Universe 24.

1.1.1 install the dhcp service pack

Yum install-y dhcp

1.1.2 modify dhcpd.conf configuration file

[root@localhost ~] # cat / etc/dhcp/dhcpd.conf

#

# DHCP Server Configuration file.

# see / usr/share/doc/dhcp*/dhcpd.conf.example

# see dhcpd.conf (5) man page

#

Subnet 192.168.56.0 netmask 255.255.255.0 {

Range 192.168.56.15 192.168.56.20

Default-lease-time 600

Max-lease-time 7200

Filename "pxelinux.0"

Next-server 192.168.56.14

}

# subnet 192.168.56.0 netmask 255.255.255.0 server IP network segment and mask

# range 192.168.56.15 192.168.56.20; address range distributed by dhcp

# default-lease-time 600: maxMuaseMutual time 7200; IP address lease time.

# filename "pxelinux.0"; specify the location of the boot file, which is the pxelinux.0 under the root directory of TFTP

# next-server 192.168.56.14; TFTP server address.

1.2 TFTP Server

Mainly provides the boot file pxelinux.0,vmlinuz (microsystem kernel basic process file) and initrd.img (driver file) for the client.

1.2.1 install the tftp-server service pack

Yum install-y tftp-server

Cd / etc/xinetd.d/

Vim tftp-> disable= no

Systemctl restart xinetd

Systemctl status xinetd

Systemctl enable xinetd

Systemctl start tftp.socket

Systemctl status tftp.socket

Systemctl enable tftp.socket

1.2.2 Import pxelinux.0 boot file

Yum install-y syslinux

Cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot/

1.2.3 Import the tftp boot configuration file, please refer to the CD file isolinux.cfg modification, this article RHEL7.2 system installation CD mount location / mnt/cdrom

Cp / mnt/cdrom/isolinux/isolinux.cfg / var/lib/tftpboot/pxelinux.cfg/default

Edit the tftp boot configuration file / var/lib/tftpboot/pxelinux.cfg/default, and the kickstart response file in this article is published in httpd mode, as follows

Default linux

Label linux

Menu label ^ Install Oracle Linux 7.2

Kernel vmlinuz

Append initrd=initrd.img quiet ks= http://192.168.56.14/ks.cfg

1.2.4 Import vmlinuz (microsystem kernel basic process file) and initrd.img (driver file) into the tftp root directory / var/lib/tftpboot/. Vmlinuz and initrd.img files are available on CD / isolinux and / images/pxeboot/.

Cp / mnt/cdrom/isolinux/vmlinuz / mnt/cdrom/isolinux/initrd.img / var/lib/tftpboot/

2 kickstart configuration, this system installation CD installation package is released by httpd

2.1 utilize the existing / root/anaconda-ks.cfg response files of the server using the CD-ROM installation system

Cp / root/anaconda-ks.cfg / root/ks.cfg

The edit ks.cfg installation section is made up of

# Use CDROM installation media

Cdrom

Modify to

# Use CDROM installation media

# cdrom

Url-- url= http://192.168.56.14/cdrom

2.2 install the httpd service pack

Yum install httpd-y

Systemctl start httpd.service

Systemctl enable httpd.service

Ln-s / root/ks.cfg / var/www/html/ks.cfg

Ln-s / mnt/cdrom / var/www/html/cdrom

Test whether the release is successful

Curl / root/anaconda-ks.cfg / root/ks.cfg

Attachment 1

Ks.cfg content used in this article

# version=DEVEL

# System authorization information

Auth-enableshadow-passalgo=sha512

Repo-name= "Server-HighAvailability"-baseurl= file:///run/install/repo/addons/HighAvailability

Repo-name= "Server-ResilientStorage"-baseurl= file:///run/install/repo/addons/ResilientStorage

Repo-name= "Server-Mysql"-baseurl= file:///run/install/repo/addons/Mysql

# Use CDROM installation media

# cdrom

Url-- url= http://192.168.56.14/cdrom

# Use graphical install

Graphical

# Run the Setup Agent on first boot

# firstboot-enable

Firstboot-disable

Ignoredisk-only-use=sda

# Keyboard layouts

Keyboard-vckeymap=us-xlayouts='us'

Reboot

# System language

Lang en_US.UTF-8

# Network information

Network-bootproto=dhcp-device=eno16777736-onboot=off-ipv6=auto

Network-bootproto=dhcp-device=eno33554960-onboot=off-ipv6=auto

Network-bootproto=dhcp-device=eno50332184-onboot=off-ipv6=auto

Network-bootproto=dhcp-device=eno67109408-onboot=off-ipv6=auto

Network-hostname=localhost.localdomain

# Root password

Rootpw-- iscrypted $6 $HRay0x3FtyDeuJAp$FlglnmnqJVL.Q0o/L574ZXEAanEtcfbak15.yUMFxHmVZxAYA9bglWMMI/YdLDnSYIxUS5HzF8BrVQqcP9n8h/

# System timezone

Timezone America/New_York-isUtc

# System bootloader configuration

Bootloader-append= "crashkernel=auto"-location=mbr-boot-drive=sda

Autopart-type=lvm

# Partition clearing information

Clearpart-all-initlabel-drives=sda

# clearpart-none-initlabel-drives=sda

% packages

@ ^ minimal

@ core

Kexec-tools

% end

% addon com_redhat_kdump-- enable-- reserve-mb='auto'

% end

Attachment 2

Local CD yum source

[root@localhost html] # cat / etc/yum.repos.d/public-yum-ol7.repo

[rhel_7_iso]

Name=local iso

Baseurl= file:///mnt/cdrom/

Enable=1

Gpgcheck=0

Attachment 3

Kickstart is a custom password for root

The password for root in kickstart can be in clear text or an encrypted value.

The way to use plaintext passwords:

Rootpw-plaintext redhat

Use encryption:

Rootpw-- iscrypted $6 $HRay0x3FtyDeuJAp$FlglnmnqJVL.Q0o/L574ZXEAanEtcfbak15.yUMFxHmVZxAYA9bglWMMI/YdLDnSYIxUS5HzF8BrVQqcP9n8h/

Like the password shadow of the linux system, the generation method is as follows:

Perl-e'print crypt ("jeffery", Q ($1 $VSmile07)), "\ n"

# where Jeffery is the password to be set for the user, and the $1 $VSmile07 string is a custom string. The format of $1$ followed by 8 characters is usually used in shadow.

The password string generated is as follows:

$1 $VSmile07 $KXKn1fJznUJeTRLQx7duB/

There is a $in the middle, with salt in front of it, and the encryption value at the end, which is called hash.

Crypt itself defaults to des algorithm.

Use the md5 algorithm if salt starts with $1 $

The des algorithm commands are as follows:

Perl-e'print crypt ("jeffery", "/ g"), "\ n"'

The password string generated is as follows:

/ gtivxtepbAM6

To sum up, if you want to set your custom password to "jefferypass-007"

In this way, you can get:

Perl-e'print crypt ("jefferypass-007", Q ($1$ BYJeffery)), "\ n"

Your password is: $1$ BYJeffer$lwi40dGdfhoenhqrSxwNG/

The $1$ BYJeffer here is a custom string.

The above is all the contents of the article "how to install the RHEL7 operating system in PXE+kickstart". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report