Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ To install PXE + Kickstart under CentOS 6.x operating system     - A brief description of Java 8 new features introduced syntax (Programming)

- How a lot of blocking malicious IP address in Linux (Linux)

- Linux 64-bit porting (Programming)

- Windows 7 hard disk to install Ubuntu 14.10 (Linux)

- Vagrant build LNMP environment (Server)

- Easy to get hidden administrator account (Linux)

- How to Install 3.16.7 CKT2 kernel in Ubuntu 14.10, Ubuntu 14.04 and its derivative versions (Linux)

- Java objects are taking up much space (Programming)

- CentOS6 5 Configure SSH password Free (Linux)

- J2EE Example of Filter (Programming)

- Python script running in the background (Programming)

- Use window.name + iframe cross-domain access to data Detailed (Programming)

- Spark and Hadoop comparison (Server)

- What have we learn from the front-end application Nodejs (Programming)

- Linux-du and df command (Linux)

- Python implementation Bursa transition model (Programming)

- C ++ CBitmap, HBitmap, Bitmap difference and contact (Programming)

- Python kills corresponding process according to pid (Programming)

- MySQL main and backup replication structures (using mysqld_multi) (Database)

- CentOS / Linux SWAP partitions added (Linux)

  To install PXE + Kickstart under CentOS 6.x operating system
  Add Date : 2018-11-21      
  First, foreword
 This article is mostly refer to:

Mainly used for learning.

1.1 What is the pxe
  PXE (Pre-boot Execution Environment, Pre-Boot Execution Environment) is the latest technology developed by Intel, working in network mode Client / Server, and support for workstations through the network from a remote server to download the image, and thereby support the network boot operations system during startup, the terminal requires the server to assign IP addresses, and then TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file transfer protocol) protocol to download a software package to start the machine's memory executed by the startup software complete basic terminal software settings to boot the operating system pre-installed on the terminal server.
  Strictly speaking, PXE installation is not a way, but a boot mode. PXE installation of the necessary conditions is to be installed on the computer must contain a PXE support for NIC (NIC), namely card must have a PXE Client. PXE protocol allows the computer to boot through the network. This protocol is divided into Client-side and Server-side, and PXE Client in the card ROM. When the computer boots, BIOS into memory to perform PXE Client, and then by the PXE Client will be placed at the distal end of the file is downloaded to run locally through a network. Run PXE protocol need to set up a DHCP server and TFTP server. DHCP server will PXE Client (to be installed in the host system) assigned an IP address, because it is assigned to the PXE Client IP address when configuring DHCP server need to add the appropriate PXE settings. In addition, the PXE Client of the ROM, already exists TFTP Client, then it may be the TFTP Server TFTP protocol to download the files.
PXE working process:
1. PXE Client from their PXE boot NIC, to obtain a copy of this IP network DHCP server;
2. DHCP server returns the client allocated to the IP and place the PXE file (the file is usually placed on a TFTP server);
3. PXE Client Request pxelinux.0 file to this network TFTP server;
After the implementation of the document made pxelinux.0 4. PXE Client Files;
5. The results of the implementation of pxelinux.0, loading the kernel and file system via TFTP server;
6. Enter the installation screen, then you can choose one of HTTP, FTP, NFS way to install;

1.2 What is kickstart? anaconda
  Kickstart is a way to install unattended. It works by recording typical manual intervention is required to fill in various parameters (QA), and generates a file named ks.cfg during installation. If (not limited to generating Kickstart installation file machines) the situation appears to fill in the parameters of the installation process, the installer will first go to find Kickstart files generated, if the appropriate parameters to find, on the use of parameters found; if not found appropriate parameters, the installer will need to manually intervened. So, if Kickstart file covers all the parameters required to complete the installation process may appear, then the installer can only tell the installer where to take the ks.cfg file, then go do your own thing. Such as the installation, the installation program will be based ks.cfg settings restart the system and complete the installation.
PXE + Kickstart unattended operating system installation process is complete

Second, the test environment
Experimental environment: VMware Workstation 11
Platform: CentOS release 6.5 (minimum installation)
Network mode:
Server: a total of two network cards, eth0: bridging mode, eth1: VMnet3

Firewall off / iptables: Firewall is not running.
SELINUX = disabled

[Root @ skype ~] # chkconfig iptables off
[Root @ skype ~] # setenforce 0
[Root @ skype ~] # getenforce
## Edit / etc / sysconfig / selinux, SELINUX = disabled, restart to take effect
[Root @ skype ~] # vi / etc / sysconfig / selinux
# This file controls the state of SELinux on the system.
# SELINUX = can take one of these three values:
# Enforcing - SELinux security policy is enforced.
# Permissive - SELinux prints warnings instead of enforcing.
# Disabled - No SELinux policy is loaded.
SELINUX = disabled
# SELINUXTYPE = can take one of these two values:
# Targeted - Targeted processes are protected,
# Mls - Multi Level Security protection.
SELINUXTYPE = targeted

Client: eth0: VMnet3

Third, the way to configure HTTP installation
  Installation of the system can select HTTP, FTP, NFS, we are here to install HTTP mode, Client by http protocol to download and install the Server-side tree, install the other two methods, we can own Baidu.
3.1 installed and configured httpd
# Install httpd
[Root @ skype ~] # yum -y install httpd
[Root @ skype ~] # chkconfig httpd on
[Root @ skype ~] # service httpd start
Starting httpd: httpd: apr_sockaddr_info_get () failed for skype
httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName
[Root @ skype ~] # netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID / Program name
tcp 0 0* LISTEN 1039 / sshd
tcp 0 0* LISTEN 1115 / master
tcp 0 0 ::: 80 ::: * LISTEN 11275 / httpd
tcp 0 0 ::: 22 ::: * LISTEN 1039 / sshd
tcp 0 0 :: 1: 25 ::: * LISTEN 1115 / master
# We see that 80 port is already in a listening state

3.2 Upload iso image file

# Mount iso image
[Root @ skype ~] # mount / dev / cdrom / mnt
mount: block device / dev / sr0 is write-protected, mounting read-only
# Copy the entire contents of the disc to the http documentroot directory: / var / www / html
[Root @ skype ~] # cp -ar / mnt / / var / www / html

Fourth, configure the TFTP
4.1 Installing tftp-server
# Install xinetd, tftp-server
[Root @ skype ~] # yum -y install xinetd
[Root @ skype ~] # yum -y install tftp-server
# Tftp edit the configuration file, disable set to no
[Root @ skype ~] # vi /etc/xinetd.d/tftp
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
# Start tftp service, since by the xinetd tftp control, so it is necessary to restart the xinetd service
[Root @ skype ~] # service xinetd start
Starting xinetd: [OK]
# Set xinetd boot
[Root @ skype ~] # chkconfig xinetd on

5, configuration support PXE boot program
5.1 pxelinux.0 copy files to / var / lib / tftpboot / folder
[Root @ skype ~] # yum -y install syslinux
# Cp /usr/share/syslinux/pxelinux.0 / var / lib / tftpboot /

Description: syslinux is a very powerful boot loader, and is compatible with a variety of media. More precisely: SYSLINUX is a small Linux operating system, which is intended to simplify the installation of Linux first time, and the establishment of repair or other special-purpose boot disks.

5.2 Copy iso mirror and vmlinux of /image/pxeboot/initrd.img to / var / lib / tftpboot / folder
# Cp /var/www/html/mnt/images/pxeboot/{initrd.img,vmlinuz} / var / lib / tftpboot /

5.3 iso image copy of /isolinux/*.msg to / var / lib / tftpboot / folder
# Cp /var/www/html/mnt/isolinux/*.msg / var / lib / tftpboot /

5.4 Creating a pxelinux.cfg directory / var / lib / tftpboot / in
# Mkdir /var/lib/tftpboot/pxelinux.cfg

5.5 iso image in the / isolinux directory isolinux.cfg pxelinux.cfg copied to the directory, and change the file name to default
# Cp /var/www/html/mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

5.6 modify the default file
# Vi /var/lib/tftpboot/pxelinux.cfg/default
default ks # is enabled by default 'label ks' marked boot kernel
prompt 1 # show 'boot:' prompt. When '0' is not prompt, it will directly start 'default' parameter specifies.
timeout 6 # before the user input timeout in 1/10 seconds.
display boot.msg # displays the path contents of a file, note the file. The default is in the / var / lib / tftpboot / directory. You can also specify bit similar '/install/boot.msg' this path + file name.
The documents show that after F1 boot.msg # Press 'F1' such key.
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux # 'label' you specified in the 'boot:' prompt enter the keyword, such as boot: linux [ENTER], this starts the kernel and initrd.img files under 'label linux' tag.
  kernel vmlinuz #kernel parameter specifies the start of the kernel.
  append initrd = initrd.img #append specify additional kernel parameters, parameters can be appended to the kernel in grub in use here also can be used.
label text
  kernel vmlinuz
  append initrd = initrd.img text
label ks
  kernel vmlinuz
  append ks = http: // initrd = initrd.img # tell the system where to get ks.cfg file
label local
  localboot 1
label memtest86
  kernel memtest
  append -

VI. Configuring DHCP
6.1 Installing the DHCP Service
# Yum -y install dhcp

6.2 Copy configuration template file to the DHCP configuration directory
# Cp -f /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

6.3 /etc/dhcp/dhcpd.conf modify configuration files or directly create an empty file dhcpd.conf, which reads as follows:
ddns-update-style interim;
ignore client-updates;
filename "pxelinux.0"; #pxelinux startup file location;
next-server; IP address of #TFTP Server;
subnet netmask {
        option routers;
        option subnet-mask;
        range dynamic-bootp;
        default-lease-time 21600;
        max-lease-time 43200;

Over 6.4 NIC
There is another problem: If you are running dhcpd machines have more than one card, you also need to tell dhcpd is working on a piece of card interface:

[Root @ skype ~] # vi / etc / sysconfig / dhcpd
DHCPDARGS = "eth1"

6.5 start the DHCP service
# /etc/init.d/dhcpd Start
# Chkconfig dhcpd on

Seven, created ks.cfg script
Copy /root/anaconda-ks.cfg /var/www/html/ks.cfg, and then edit the actual situation. Note Do not include Chinese characters in this file.
# Url --url = http: // # This option tells Setup: mnt file server to the HTTP folder under the root directory of the installation media to find
# Platform = x86, AMD64, or Intel EM64T
# Version = DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
# Use network installation
url --url = http: //
# Root password
rootpw --iscrypted $ 6 $ 060kt9rryFXbrlgx $ WWWNQYLnpz0Es8dTlouy3LXqjTdHIRToojidbpYoZrd2ETOJ.JsNbgnMylQVbFRThPZwSdRKJcrAml7LQDdR00
# System authorization information
auth --useshadow --enablemd5
# Use graphical install
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level = info
# Reboot after installation
# System timezone
timezone --utc Asia / Shanghai
# Network information
network --bootproto = dhcp --device = eth0 --onboot = on
# System bootloader configuration
key --skip
bootloader --append = "rhgb quiet" --location = mbr --driveorder = sda
# Clear the Master Boot Record
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part / --fstype = "ext4" --size = 8192
part swap --fstype = "swap" --size = 1024
part / data --fstype = "ext4" --size = 2048
% Packages
% End

Description: key --skip if Red Hat system, this option can skip entering the serial number of the process; if it is CentOS series, you can not retain the contents of this;
reboot This option must exist, it must also be set in the position paper, or kickstart displays a message and waits for the user to press any key after reboot;
clearpart --all --initlabel this command must be added, otherwise the system will let the user choose whether to clear all the data manually, which requires human intervention, and thus lead to an automated process to fail;
The default installation is complete, root user password is: 123456;
Hard at least 12G;

Eight, installation and testing
Automated Installation system configuration is complete, start following a new machine to test the process of creating a virtual machine is not talked about, the network connection mode VMnet3.

Start the virtual machine, press the F2, modify BIOS, choose from the card to start, DHCP server is to assign IP addresses to clients.

After installation is complete, restart. Since then, PXE + Kickstart unattended installation of the operating system environment set up is completed.
- Command filter MySQL slow query log (Database)
- Redis configuration file interpretation (Database)
- In the case of using cgroups Ubuntu 14.04 and Docker (Linux)
- C ++ 11 smart pointers (Programming)
- Linux common commands ll namely ls -l --color = auto (Linux)
- Getting Started Linux Shell Scripting (Programming)
- Node.JS different ways to install under Ubuntu 15.04 (Linux)
- Security basics: simple analytical framework for Linux system firewall (Linux)
- Use Tmux and Vim to make IDE (Linux)
- OpenGL Superb Learning Notes - Depth Texture and Shadows (Programming)
- ORA-00845: MEMORY_TARGET not supported on this system Problem (Database)
- How to install Git on CentOS 7 (Linux)
- React Getting Started Tutorial (Linux)
- Python Basics: Search Path (Programming)
- Android View event delivery (Programming)
- JavaScript basic tools list (Programming)
- How to view the Linux program or process used in the library (Linux)
- Oracle archive log size than the size of the online journal of the much smaller (Database)
- Linux (SUSE) mount NTFS mobile hard practice (Linux)
- MySQL management partition table (Database)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.