Use PXE + DHCP + TFTP + APACHE to automatically install LINUX instances in VM

Source: Internet
Author: User
Tags gstreamer
Test preparation: One Installation server (CentOS5.5 under the vm) will use the following kits on the Installation server: dhcp, tftp, httpd first: is set on the Installation server [root @ localhost ~] # Yum-yinstalltftp-serverdhcphttpd check installation kits [root @ localhost ~] # Vie

Lab preparation: One Installation server (CentOS5.5 under the vm)

 

The kit used on the Installation server is dh.Cp, TFtp,Httpd

First, it is the settings on the Installation server.

[Root @ localhost ~] # Yum-y installTftp-Server dhcp httpd // check installation kits

[Root @ localhost ~] # Vi/etc/dhcpd. conf // configure dhcpd

DdNs-upDate-Style interim;

Ignore client-updates;

 

SuBnet 192.168.1.0 netmask 255.255.255.0 {

 

# --- Default gateway

Option routers 192.168.1.1; // GATEWAY

Option subnet-mask limit 255.0; // NETMASK

 

Option nis-domain "domain.org ";

Option domain-name "domain.org ";

Option domain-name-servers 202.102.240.65; // DNS-server-IP

 

OptionTime-OffSet-18000; # Eastern Standard Time

 

Range dynamic-bootp 192.168.1.128 192.168.1.254;

Default-lease-time 21600;

Max-lease-time 43200;

 

NExT-server 192.168.1.193; // This is the IP address of the server to be installed.

FileName "/pxelinux.0 ";

}

The next step is to configure the automatic installation options. If you prefer to manually configure the System Options (that is, the normal installation steps), the next step may not be used.

[Root @ localhost ~] # Vi/var/www/html/ethnicity. cfg

# Kickstart file automatically generatEdBy anaconda.

Install

Nfs -- server = 192.168.1.193 -- dir =/mnt/iso

Key -- skip

Lang en_US.UTF-8

Keyboard us

Xconfig -- startxonboot -- resolution 1024x768 -- depth 16

Network -- device eth0 -- bootproto dhcp

Rootpw -- iscrypted $1 $ rjNWMWwe $ y84mj/abysrju3znt07133/

FireWall-- Disabled

Authconfig -- useshadow --EnableMd5

Selinux -- enforcing

Timezone -- utc Asia/Shanghai

Bootloader -- loCatIon = mbr -- driveorder = sda -- append = "rhgb quiet"

# The following is the partition infoRmAtion you requested

# Note that any partitions you deleted are notExprEsSed

# Here so unLessYouClearAll partitions first, this is

# Not guaranTeeD to work

Clearpart -- all

Part/boot -- fstype ext3 -- size = 100

Part pv.100000 -- size = 18000

Part swap -- size = 512

Volgroup vol0 -- pesize = 32768 pv.100000

Logvol/home -- fstype ext3 -- name = home -- vgname = vol0 -- size = 480

Logvol/-- fstype ext3 -- name = root -- vgname = vol0 -- size = 8192

% Packages

@ GNOME Desktop Environment

@ X Window System

@ Printing Support

@ Development TooLs

Elinks

Openssh

Openssh-server

Openssh-clients

Vim-enhaNcEd

Samba-common

Samba-client

Gimp

Gimp-data-exTrAs

Enscript

Libcap

Ntp

Coreutils

Elfutils

Elfutils-libelf

Gimp-print-plugin

Gnome-icon-theme

Gstreamer

Gstreamer-tools

Libgnomeprint22

Libgnomeprintui22

Libgsf

LibIDL

Libraw1394

Nautilus-Cd-Burner

Openmotif

Pyorbit

Startup-notification

Ttmkfdir

Firefox

Mutt

Then Configure NFS (that is, set the installation tree)

[Root @ localhost ~] # Mount-o loop/dev/hdc/mnt/iso/

[Root @ localhost ~] # Vi/etc/ExportS

/Mnt/iso * (ro)

[Root @ localhost ~] #/Etc/init. d/portmap restart

[Root @ localhost ~] #/Etc/init. d/nfs restart

[Root @ localhost ~] # Exportfs-arv

Exporting *:/mnt/iso

Set TFTP (in fact, it is enough to open it)

[Root @ localhost ~] # Vi/etc/xinetd. d/tftp

Service tftp

{

Socket_type = dgram

ProtoCol= Udp

Wait = yes

User = root

Server =/usr/sbin/in. tftpd

Server_args =-s/tftpboot

Disable = no

Per_source = 11

CPIs = 100 2

Flags = IPv4

}

 

Then configure PXE.

[Root @ localhost/] # cp/usr/lib/syslinux/pxelinux.0/tftpboot/

[Root @ localhost/] # mount-o loop/dev/hdc/mnt/iso

[Root @ localhost/] # cp/mnt/iso/images/pxeboot/{initrd. img, vmlinuz}/tftpboot/

[Root @ localhost/] # cp/mnt/iso/isolinux/*. msg/tftpboot/

[Root @ localhost/] #Mkdir/Tftpboot/pxelinux. cfg

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

[Root @ localhost ~] # Cd/tftpboot/pxelinux. cfg/

[Root @ localhost pxelinux. cfg] #ChmodA + w default

[Root @ localhost pxelinux. cfg] # vi default // This setting indicates that there is a menu during installation and startup.

Default linux

Prompt 1

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.