Linux Unattended Installation

Source: Internet
Author: User
Tags file transfer protocol

Linux Unattended Installation

I. Principle Analysis

 

1. Process Flow

2. pxe Principle

 

PXE (preboot execute environment) is the latest technology developed by Intel. It works in the Client/Server network mode and supports workstation to download images from remote servers over the network, this also supports the Startup Process of the operating system from the network. During the startup process, the terminal requires the server to assign an IP address, and then use TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file transfer protocol) download a startup software package to the local memory and execute it. the startup Software Package completes the basic software settings of the terminal to guide the terminal operating system that is pre-installed on the server. PXE can guide a variety of operating systems, such as Windows 95/98/2000 and Linux.

 

3. Dhcp

 

4. Simple tftp File Transfer Protocol

 

5. nfs Network File Transfer System

 

6. kickstart

 

The ks. cfg file in the following section is the configuration file of kickstart, which records the parameters required by manual intervention during typical installation.

 

Ii. Experiment steps

 

1. Configure the IP address 192.168.0.100 for the local machine.

 

2. Install dhcp

 

[Root @ localhost Server] # rpm-ivh dhcp-3.0.5-18.el5.i386.rpm

 

[Root @ localhost ~] # Cp/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample/etc/dhcpd. conf

 

[Root @ localhost Server] # vi/etc/dhcpd. conf

 

Subnet192.168.0.0 netmask 255.0.0.0 {(assign the ip address of the 100 network segment)

 

Option routers 192.168.0.100; (GATEWAY)

 

Option subnet-mask limit 255. 0; (subnet mask)

 

Range dynamic-bootp 192.168.0.110 192.168.0.220; (ip address range allocated)

 

Filename "pxelinux.0"; (add the program command for network startup)

 

Next-server 192.168.0.100; (your own ip address-the ip address of the server)

 

}

 

3. Install tftp and configure pxe.

 

[Root @ localhost Server] # rpm-ivh tftp-0.42-3.1.i386.rpm

 

# Rpm-ivh tftp-server-0.42-3.1.i386.rpm

 

[Root @ localhost Server] # cd/tftpboot/

 

[Root @ localhost tftpboot] # cp/media/isolinux/*/tftpboot/(upload all files in the isolinux disk to the tftpboot directory)

 

[Root @ localhost tftpboot] # mkdir pxelinux. cfg/(create directory)

 

[Root @ localhost tftpboot] # cp *. msg/tftpboot/pxelinux. cfg/(copy the. msg file to the directory)

 

[Root @ localhost tftpboot] # cp isolinux. cfg pxelinux. cfg/

 

[Root @ localhost tftpboot] # cd pxelinux. cfg/

 

[Root @ localhost pxelinux. cfg] # mv isolinux. cfg default (rename)

 

[Root @ localhost pxelinux. cfg] # cp/usr/lib/syslinux/pxelinux.0/tftpboot/(copy the Startup file to the startup directory)

 

(Ensure that there must be three boot. msg vmlinuz initrd. img files under tftp)

 

[Root @ localhost pxelinux. cfg] # chkconfig tftp on (enable the tftp service)

 

[Root @ localhost pxelinux. cfg] # service xinetd restart

 

[Root @ localhost pxelinux. cfg] # service iptables stop (disable firewall)

 

4. Configure nfs.

[Root @ localhost/] # vi/etc/exports

/Mnt * (ro) (the directory attached to the enterprise 5 disk is used as the nfs shared directory)

~

 

--------------------------

 

[Root @ localhost/] # service nfs restart

 

6. unattended

 

(1) # vi/tftpboot/pxelinux. cfg/default (modify rows 3rd and 12th .)

 

3 timeout 10 // adjust the time to a smaller point

 

12 append ks = nfs: 192.168.0.100:/pub/ks. cfg initrd = initrd. img

 

(2) install kickstart and configure ks. cfg

 

Run the system-config-kickstart command on the virtual terminal of the graphic interface.

 

Then configure

 

,

Save the ks. cfg file to/root.

3) Create the pub directory under the/directory and move ks. cfg to this directory.

 

# Chmod 757/pub/ks. cfg modify ks. cfg Permissions

 

(4) manually modify ks. cfg

 

Bootloader -- location = mbr

 

Key -- skip // skip the installation serial number, you need to manually modify and add

 

(Add at last)

 

% Packages -- resolvedeps

 

@ Base-x // minimize installation (manually add the installation package if kickstart is not available)

 

(5) share pub/ks. cfg

 

# Vi/etc/exports // Add two rows of records

 

/Media * (ro)

 

/Pub * (ro)

 

3. Test on the client

 

Start the instance, enable the bios and select the NIC to start the instance, as shown in the following figure. Congratulations! You have mastered the unattended installation technology.

 

This article is from the "technology sharing platform" blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.