RHEL6.6 PXE安装-基于VMWare WorkStation
///////////第一部分:安装安装服务器
1.先安装一台RHEL6.6的服务器A(地址为192.168.139.132),作为安装服务器。这样后面的机器就可以指向这台服务器进行自动安装
2.在A上安装http服务器
3.将OS的文件拷贝到/var/www/html/rhel6.6
4.在A上安装createrepo工具/rhel6.6
5.在A上建立repo。指向http://192.168.139.132
6.准备kickstart文件
修改配置:由于安装服务器是用的cdrom安装,但后面的服务器需要从http服务上安装,所以需要修改
#cdrom
url --url http://192.168.139.132/rhel6.6/
将cdrom注释掉,增加一条url指令
当然也可以把fireware和selinux关掉
[root@localhost ~]# cp anaconda-ks.cfg /var/www/html/
[root@localhost ~]# chmod 777 /var/www/html/anaconda-ks.cfg
# Kickstart file automatically generated by anaconda. #version=DEVEL
install
#cdrom
url --url http://192.168.139.132/rhel6.6-install
lang en_US.UTF-
keyboard us
network --onboot yes --device eth0 --bootproto dhcp
rootpw --iscrypted $$3MFQKYIJ$ifM2hjwz62pookT7VokgJ.
# Reboot after installation
reboot
firewall --disabled
authconfig --useshadow --enablemd5
selinux --disabled
timezone --utc Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --initlabel
zerombr
part /boot --fstype=ext4 --size=
part / --fstype=ext4 --grow --size=
part swap --grow --maxsize= --size= %packages
@Base
@Core
@Desktop
@Fonts
@General Purpose Desktop
@Internet Browser
@Printing client
@X Window System
binutils
gcc
kernel-devel
make
patch
python %end %post
if [ -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; fi
if [ -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; fi
if [ -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; fi
if [ -f /etc/rc.d/rc.local ]; then cp /etc/rc.d/rc.local /etc/rc.d/rc.local.backup; fi
cat >>/etc/rc.d/rc.local <<EOF
#!/bin/bash
echo
echo "Installing VMware Tools, please wait..."
if [ -x /usr/sbin/getenforce ]; then oldenforce=\$(/usr/sbin/getenforce); /usr/sbin/setenforce permissive || true; fi
mkdir -p /tmp/vmware-toolsmnt0
for i in hda sr0 scd0; do mount -t iso9660 /dev/\$i /tmp/vmware-toolsmnt0 && break; done
cp -a /tmp/vmware-toolsmnt0 /opt/vmware-tools-installer
chmod /opt/vmware-tools-installer
cd /opt/vmware-tools-installer
mv upgra32 vmware-tools-upgrader-
mv upgra64 vmware-tools-upgrader-
mv upgrade.sh run_upgrader.sh
chmod +x /opt/vmware-tools-installer/*upgr*
umount /tmp/vmware-toolsmnt0
rmdir /tmp/vmware-toolsmnt0
if [ -x /usr/bin/rhgb-client ]; then /usr/bin/rhgb-client --quit; fi
cd /opt/vmware-tools-installer
for s in sr0 sr1; do eject -s /dev/\$s; done
./run_upgrader.sh
if [ -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; fi
rm -rf /opt/vmware-tools-installer
sed -i 's/3:initdefault/5:initdefault/' /etc/inittab
if [ -f /boot/grub/menu.lst.bak ]; then mv /boot/grub/menu.lst.bak /boot/grub/menu.lst; fi
if [ -f /boot/grub/grub.conf.bak ]; then mv /boot/grub/grub.conf.bak /boot/grub/grub.conf; fi
if [ -f /boot/grub2/grub.conf.bak ]; then mv /boot/grub2/grub.conf.bak /boot/grub2/grub.conf; fi
if [ -x /usr/sbin/getenforce ]; then /usr/sbin/setenforce \$oldenforce || true; fi
if [ -x /bin/systemd ]; then systemctl restart prefdm.service; else telinit 5; fi
EOF
chmod 755 /etc/rc.d/rc.local
if [ -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
///////////////第二部分:安装必要工具/////////////
1.安装syslinux
yum install syslinux
2.安装dhcp
yum install dhcp
需要进行配置
vi /etc/dhcp/dhcpd.conf
内容如下:
ddns-update-style interim;
ignore client-updates; allow booting;
allow bootp; class "pxeclients"{
match if substring(option vendor-class-identifier,,) = "PXEClient";
filename "pxelinux.0";
next-server 192.168.139.132;
} subnet 192.168.139.0 netmask 255.255.255.0 {
option routers 192.168.139.1;
option subnet-mask 255.255.255.0;
option time-offset -; # Eastern Standard Time
range dynamic-bootp 192.168.139.2 192.168.139.254;
default-lease-time ;
max-lease-time ;
}
service dhcpd start
chkconfig dhcpd on
3.安装tftp-server
yum install tftp-server
修改配置文件vi /etc/xinetd.d/tftp将disable由yes改为no
disable = no
拷贝启动引导文件
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
修改/var/lib/tftpboot/pxelinux.cfg/default的配置:
default linux-ks
#prompt
timeout display boot.msg menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.6!
menu color border #ffffffff #
menu color sel #ffffffff #ff000000
menu color title #ffffffff #
menu color tabmsg #ffffffff #
menu color unsel #ffffffff #
menu color hotsel #ff000000 #ffffffff
menu color hotkey #ffffffff #ff000000
menu color scrollbar #ffffffff # label linux-ks
menu label ^Install or upgrade an existing system with kickstart
menu default
kernel vmlinuz
append initrd=initrd.img ks=http://192.168.139.132/anaconda-ks.cfg
启动服务
service xinetd start
chkconfig xinetd on
///////////////第三部分:批量安装其他服务器
1.在VMWare中建立一个空白服务器。
2.启动空白服务器,此时空白服务器会自动找到安装服务器。整个过程无需人工干预
问题解决:
1.出现The storage may contain data的警告,这时需要人工干预。想去这个警告,进行全自动安装。
在ks.cfg中加入
# Clear the Master Boot Record
zerombr
2.出现ks.cfg无法访问的问题
确保ks.cfg的访问权限没问题
RHEL6.6 PXE安装-基于VMWare WorkStation的更多相关文章
- 基于VMware Workstation搭建开发服务器
基于VMware Workstation搭建开发服务器 文章为本人原创,转载请联系作者并注明出处.晓松 源URL: https://www.jianshu.com/p/e62ab7de0124 我 ...
- RHEL 6.5 PXE 安装调试 VMWARE ESXi 5.1 安装
测试环境:win10/vmware workstation 12 pro 操作系统:RHEL 6.5(PXE服务器) [2016.11.30] [遗留问题] 1.ks.cfg通过本地文件方式加载不成功 ...
- 基于VMware Workstation下Windows server的搭建
网络安全学习内容 一.VMware安装Windows系统 1.1安装配置虚拟机 需要提前准备的东西: 配置网络实验室的IP: 为了满足实验中一些需要用到网络的需求,学校为我们提供了每个人学号密码的 ...
- 《软件安装》VMware Workstation 不注册 下载
问答环节 问:为什么要下载安装VMware Workstation 答:VMware Workstation 可以安装虚拟机,我们可以把我们安装的一些软件装在虚拟机上面,防止自己的电脑卡顿(软件装多了 ...
- 基于VMware Workstation下CentOS的搭建
网络安全学习内容 二.VMware安装CentOS系统 需要准备的文件: 从http://mirrors.huaweicloud.com/centos/7.7.1908/isos/x86_64/中下载 ...
- 基于VMware Workstation在Windows Server 2008 R2上搭建SQL Server 2012高可用性组(AlwaysOn Group)测试环境(二)
接上篇: 以SERVER02为例,将服务器加入域,并安装故障转移群集:(SERVER02-SERVER-04操作相同)
- VMware workstation批量创建虚拟机和自动化安装操作系统(一)
一. 简述 作为从事IT行业运维工作的Linuxer,大多情况下需要在测试环境中部署业务系统并进行测试,在没有足够的计算存储网络条件下,使用虚拟机进行虚拟集群的创建和使用,是一种不错的学习和实践方式. ...
- VMWare Workstation 11的安装
不多说,直接上干货! 说白了 VMWare Workstation是收费的! VMware Player 和 VirtualBox是免费的! 虚拟机软件可让你在一个操作系统上直接运行的多个不同的虚 ...
- VMware Workstation 10安装详解
虚拟机软件可让你在一个操作系统上直接运行的多个不同的虚拟操作系统,譬如可在 Windows 8.1 上运行 Ubuntu 或 Win7 等.免费的 VMware Player 和 VirtualBox ...
随机推荐
- Query Designer:公式冲突
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- 调度系统任务创建---创建一个JoinTrigger的依赖任务(五)
有时候我们需要创建一个任务,这个任务有多个下游任务,在所有下游任务执行成功后再触发一个join操作. 这种场景可以使用JoinTrigger的触发器来实现. 该场景对应的拓扑结构如下: 该触发器的详细 ...
- String转double或者float会有精度丢失的问题
float [] value=new float[5]; value[0]=Float.parseFloat(rs.getString(1)); value[1]=Float.parseFloat(r ...
- jQuery get() 函数
get() 函数 用于获取当前jQueryobject对象所匹配的DOM元素 语法 jQueryobject.get(index)//因为在JQuery中.很多时候和[]等价所以jQueryobjec ...
- Python_Day4_函数
本节内容 1. 函数基本语法及特性 2. 参数与局部变量 3. 返回值 嵌套函数 4.递归 5.匿名函数 6.函数式编程介绍 7.高阶函数 8.内置函数 定义: 函数是指将一组语句的集合通过一个名字( ...
- 搭建nginx+tomcat+Java的负载均衡环境
转载 未测 供参考 另外这篇文章也不错.http://blog.csdn.net/wang379275614/article/details/47778201 一.简介: Tomcat在高并发环境下 ...
- spring框架学习(二)依赖注入
spring框架为我们提供了三种注入方式,分别是set注入,构造方法注入,接口注入.接口注入不作要求,下面介绍前两种方式. 1,set注入 采用属性的set方法进行初始化,就成为set注入. 1)给普 ...
- this
JavaScript 中的 this ! 2016-12-28 vvv阿城 JavaScript 转自 https://qiutc.me/post/this-this-this-in-javascr ...
- 不在折腾----zookeeper-3.4.5
上传zk安装包 解压 配置(先在一台节点上配置) * 添加一个zoo.cfg配置文件 $ZOOKEEPER/conf mv zoo_sample.cfg zoo.cfg * 修改配置文件(zoo.cf ...
- 简单的验证码识别(opecv)
opencv版本: 3.0.0 处理验证码: 纯数字验证码 (颜色不同,有噪音,和带有较多的划痕) 测试时间 : 一天+一晚 效果: 比较挫,可能是由于测试的图片是在太小了的缘故. 原理: 验证码 ...