RHEL6.6 PXE installation-based on VMware WorkStation

Source: Internet
Author: User

Part I: Installing the installation Server

1. Install a RHEL6.6 Server A (address 192.168.139.132) as the installation server. So that the machine behind it can point to this server for automatic installation

2. Install the HTTP server on a

3. Copy the OS files to the/var/www/html/rhel6.6

4. Install the Createrepo tool on a/rhel6.6

5. Establish the repo on a. Point to http://192.168.139.132

6. Prepare the Kickstart file

Modify configuration: Because the installation server is CDROM installed, but the subsequent server needs to be installed from the HTTP service, so you need to modify

#cdrom
URL--url http://192.168.139.132/rhel6.6/
Comment out cdrom, add a URL directive

Of course, you can turn fireware and selinux off.

[email protected] ~]# CP anaconda-ks.cfg/var/www/html/
[Email protected] ~]# chmod 777/var/www/html/anaconda-ks.cfg

# Kickstartfileautomatically generated by Anaconda. #version=DEVELInstall#cdromurl--url http://192.168.139.132/rhel6.6-installLang en_US. utf-8keyboard Usnetwork--onboot Yes--device eth0--Bootproto DHCPROOTPW--iscrypted $1$3mfqkyij$ifm2hjwz62pookt7vokgj.# Reboot after Installationrebootfirewall--Disabledauthconfig--useshadow--Enablemd5selinux--Disabledtimezone--UTC asia/Shanghaibootloader--LOCATION=MBR--DRIVEORDER=SDA--append="Crashkernel=auto RHGB Quiet"# The following is the partition information you requested# Note This any partitions you deleted be not expressed# he Re so unlessClearAll partitions First, this is# not guaranteed to Workclearpart--all--Initlabelzerombrpart/boot--FSTYPE=EXT4--size= - Part/--FSTYPE=EXT4--grow--size= thePart Swap--grow--maxsize=2048--size=2048%packages@base@core@desktop@fonts@general Purpose desktop@internet browser@printing client@x Window SystembinutilsGCCKernel-devel MakePatchpython%End%Postif[-f/boot/grub/menu.lst-a!-h/boot/grub/menu.lst]; Then CP/boot/grub/menu.lst/boot/grub/menu.lst.bak &&sed-I.'s/rhgb//'/boot/grub/menu.lst;fiif[-f/boot/grub/grub.conf-a!-h/boot/grub/grub.conf]; Then CP/boot/grub/grub.conf/boot/grub/grub.conf.bak &&sed-I.'s/rhgb//'/boot/grub/grub.conf;fiif[-f/boot/grub2/grub.conf-a!-h/boot/grub2/grub.conf]; Then CP/boot/grub2/grub.conf/boot/grub2/grub.conf.bak &&sed-I.'s/rhgb//'/boot/grub2/grub.conf;fiif[-f/etc/rc.d/rc.local]; Then CP/etc/rc.d/rc.local/etc/rc.d/rc.local.backup;fiCat>>/etc/rc.d/rc.local <<eof#!/bin/BashEchoEcho "Installing VMware Tools, please wait ..."if[-x/usr/sbin/getenforce]; Thenoldenforce=\$ (/usr/sbin/getenforce); /usr/sbin/setenforce Permissive | |true;fimkdir-p/tmp/vmware-toolsmnt0 forIinchHDA Sr0 scd0; Do Mount-T iso9660/dev/\ $i/tmp/vmware-toolsmnt0 && break; DoneCP-a/tmp/vmware-toolsmnt0/opt/vmware-tools-Installerchmod 755/opt/vmware-tools-INSTALLERCD/opt/vmware-tools-InstallerMVUpgra32 vmware-tools-upgrader- +MVUpgra64 vmware-tools-upgrader- -MVUpgrade.SHRun_upgrader.SHchmod+x/opt/vmware-tools-installer/*upgr*umount/tmp/vmware-toolsmnt0rmdir/tmp/vmware-toolsmnt0if [-x/usr/bin/rhgb-client]; Then/usr/bin/rhgb-client--quit; Ficd/opt/vmware-tools-installerfor s in Sr0 SR1; Do eject-s/dev/\ $s; Done./run_upgrader.shif [-f/etc/rc.d/rc.local.backup]; Then mv/etc/rc.d/rc.local.backup/etc/rc.d/rc.local; else Rm-f/etc/rc.d/rc.local; Firm-rf/opt/vmware-tools-installersed-i ' s/3:initdefault/5:initdefault/'/etc/inittabif [-f/boot/grub/ Menu.lst.bak]; Then Mv/boot/grub/menu.lst.bak/boot/grub/menu.lst; Fiif [-f/boot/grub/grub.conf.bak]; Then mv/boot/grub/grub.conf.bak/boot/grub/grub.conf; Fiif [-f/boot/grub2/grub.conf.bak]; Then mv/boot/grub2/grub.conf.bak/boot/grub2/grub.conf; Fiif [-x/usr/sbin/getenforce]; Then/usr/sbin/setenforce \ $oldenforce | | True Fiif [-X/BIN/SYSTEMD]; then systemctl restart Prefdm.service; else Telinit 5; Fieofchmod 755/etc/rc.d/rc.localif [-X/BIN/SYSTEMD]; Then systemctl enable Rc-local.service; Fi/usr/sbin/adduser littlesuccess/Usr/sbin/usermod-p ' $1$3mfqkyij$ifm2hjwz62pookt7vokgj. ' littlesuccess/usr/bin/chfn-f ' RHEL6.6 ' littlesuccess/bin/ Echo Done%end

Part II: Installation of the necessary tools/////////////

1. Installing Syslinux

Yum Install Syslinux

2. Install DHCP

Yum Install DHCP

Need to be configured

Vi/etc/dhcp/dhcpd.conf

The contents are as follows:

ddns-update-Style Interim;ignore Client-updates;allow Booting;allow Bootp;class"pxeclients"{MatchifSUBSTRING (option Vendor-class-identifier,0,9) ="pxeclient"; filename"pxelinux.0"; next-server192.168.139.132;} Subnet192.168.139.0Netmask255.255.255.0{option Routers192.168.139.1; option Subnet-mask255.255.255.0; option Time-offset-18000; # Eastern standard timerange Dynamic-bootp192.168.139.2 192.168.139.254;d efault-lease- Time 216000; Max-lease- Time 432000;}

Service DHCPD Start

Chkconfig DHCPD on

3. Installing Tftp-server

Yum Install Tftp-server

Modify configuration file Vi/etc/xinetd.d/tftp change disable from Yes to No

Disable = no

Copy boot boot file

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

cp/usr/share/syslinux/vesamenu.c32/var/lib/tftpboot/

Cp/var/www/html/rhel6.6/images/pxeboot/{initrd.img,vmlinuz}/var/lib/tftpboot/

Mkdir/var/lib/tftpboot/pxelinux.cfg

Cp/var/www/html/rhel6.6/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default

To modify the configuration of the/var/lib/tftpboot/pxelinux.cfg/default:

default linux- ks#prompt1 Timeout  ten display Boot.msgmenu background splash.jpgmenu title Welcome to Red Hat Enterprise Linux6.6!Menu Color Border0#ffffffff #00000000Menu Color sel7#ffffffff #ff000000menu Color title0#ffffffff #00000000Menu Color Tabmsg0#ffffffff #00000000Menu Color Unsel0#ffffffff #00000000Menu Color Hotsel0#ff000000 #ffffffffmenu Color Hotkey7#ffffffff #ff000000menu Color scrollbar0#ffffffff #00000000 label Linux- KSmenu label^Install or upgrade an existing system with Kickstartmenu Defaultkernel vmlinuzappend initrd=initrd.imgks=http://192.168.139.132/anaconda-ks.cfg 

Start the service

Service xinetd Start

Chkconfig xinetd on

Part III: Batch installation of additional servers

1. Create a blank server in VMware.

2. Start the blank server, and the blank server will automatically find the installation server. No manual intervention is required for the entire process

Problem solving:

1. The warning of the storage may contain data requires manual intervention. Want to go to this warning, carry out the automatic installation.

Join in the Ks.cfg

# Clear the Master Boot Record
Zerombr

2. Problems that Ks.cfg cannot access

Make sure that the KS.CFG access rights are no problem

RHEL6.6 PXE installation-based on VMware WorkStation

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.