PXE自动化安装CentOS6/7
服务器为centos7
安装前准备:关闭防火墙和SELINUX
虚拟机准备第二块网卡,设置主机模式,关闭虚拟机网络配置中主机模式的DHCP功能,并设置静态IP
nmcli c a con-name ens37-dhcp type ethernet ifname ens37 ipv4.method manual ipv4.addresses 192.168.47.10/24 ipv4.gateway 192.168.47.1 ipv4.dns 114.114.114.114 connection.autoconnect yes
安装软件包
dhcp,httpd,tftp-server,syslinux,system-config-kickstart
配置dhcp:
vim /etc/dhcp/dhcpd.conf
option domain-name "linux123.tech"; 设置域名
option domain-name-servers 114.114.114.114, 8.8.8.8; DNS服务器,可以不要
default-lease-time 8560; 最长租约
max-lease-time 15400; 特殊情况的最长租约
subnet 192.168.47.0 netmask 255.255.255.0 { DHCP服务网段
range 192.168.47.50 192.168.47.100; 分配地址范围
filename "pxelinux.0"; 系统安装文件名
next-server 192.168.47.10; tftp服务器地址
}
systemctl start dhcpd 启动服务
用另一台主机模式的虚拟机自动获取IP,测试DHCP服务是否正常,
配置httpd
在目录下设置创建放置ISO文件和KS文件的目录
cd /var/www/html/
mkdir ksdir 创建ks文件夹
cp /root/ks7-* /var/www/html/ksdir/ 将制作好的ks文件拷入ks7-desktop.cfg,ks7-mini.cfg,ks6-mini.cfg
mkdir centos/7 -p
mkdir centos/6
mount /dev/sr1 centos/7 挂载centos7安装盘到网络路径
mount /dev/sr2 centos/6 挂载centos6
配置tftp
cd /var/lib/tftpboot/
rpm -ql syslinux 找到pxelinux.0和menu.c32的路径
cp /usr/share/syslinux/{pxelinux.0,menu.c32} .
cp /var/www/http/centos/6/isolinux/{vmlinuz,initrd.img} .6/ 从centos6光盘中拷贝驱动文件
cp /var/www/http/centos/7/isolinux/{vmlinuz,initrd.img} .7/ 从centos7光盘中拷贝驱动文件
mkdir pxelinux.cfg
cp /mnt/cd/isolinux/isolinux.cfg pxelinux.cfg/default 启动菜单
vim pxelinux.cfg/default 修改启动菜单项
default menu.c32
timeout 600
label linux
menu label Install ^Desktop CentOS 7
kernel 7/vmlinuz
append initrd=7/initrd.img ks=http://192.168.47.10/ksdir/k7-desktop.cfg
label check
menu label Install ^Mini CentOS 7
kernel 7/vmlinuz
append initrd=7/initrd.img ks=http://192.168.47.10/ksdir/k7-mini.cfg
label check
menu label Install ^Mini CentOS 7
kernel 6/vmlinuz
append initrd=6/initrd.img ks=http://192.168.47.10/ksdir/k6-mini.cfg
label local
menu default
menu label Boot from ^local drive
localboot 0xffff
menu end
最后,确保防火墙和selinux关闭
打开三项服务
systemctl httpd dhcpd tftp.service
空白虚拟机开机,centos7图形虚拟机的内存需要大于1.1G以上,磁盘空间也要大于分区的空间,否则会报错失败。
ks7-desktop.cfg ks7-mini.cfg相比较只是少了几个包,自行删除几个不需要的就可以了。
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
url --url=http://192.168.47.10/centos/7
# Use graphical install
firewall --disabled
selinux --disabled
text
reboot
# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=ens33 --onboot=on --ipv6=auto --activate
network --hostname=centos7.magedu.com
# Root password
rootpw --plaintext 1234567890
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
# Partition clearing information
zerombr
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="xfs" --ondisk=sda --size=1024
part / --fstype="xfs" --ondisk=sda --size=51200
part /app --fstype="xfs" --ondisk=sda --size=20480
eula --agreed
%packages
@base
@core
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@internet-browser
@multimedia
@network-file-system-client
@networkmanager-submodules
@x11
%end
%addon com_redhat_kdump --disable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post
systemctl default multi-user.target
%end
ks6-mini.cfg
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
reboot
text
url --url=http://192.168.47.10/centos/6/
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --plaintext 6803154
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone 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
zerombr
part /boot --fstype=ext4 --size=1024
part / --fstype=ext4 --size=50000
part /app --fstype=ext4 --size=20000
part swap --size=2048
%packages
@base
@core
@debugging
%end
PXE自动化安装CentOS6/7的更多相关文章
- 配置pxe 自动化安装centos6.7
dhcp服务器是pxe自动化安装的必要条件,因此先搞定dhcp服务器,yum -y install dhcp, rpm -ql dhcp查看安装了哪些包,less /etc/dhcp/dhcpd.c ...
- Linux PXE自动化安装centos6,centos7系统
1.PXE是什么? pxe是Preboot Excution Environment的缩写,是intel公司研发,基于client/server的网络模式,支持远程主机通过网络从远端服务器下载镜,并由 ...
- CentOS 6.5自动化运维之基于DHCP和TFTP服务的PXE自动化安装centos操作系统详解
前言 如果要给很多台客户端主机安装操作系统,要是每一台都拿张安装光盘一台一台主机的去装系统那就太浪费时间和精力了.在生产环境中也不实际,要实现为多台主机自动安装操作系统,那我们怎么实现自动化安装 ...
- 使用Kickstart+pxe自动化安装部署无人值守的linux服务器
Kickstart+pxe Kickstart无人职守安装RHEL5过程分享(详细图解版) 启动应用有:httpd.dhcpd.named.xinetd 无人职守自动批量安装linux系统超详细 参考 ...
- PXE自动化安装系统
准备(以centos7为例) ①关闭防火墙 ②关闭selinux ③dhcp服务设置为静态IP ④安装软件包 http:充当yum源安装包仓库 tftp-server :在它的工作目录存在引导主机的工 ...
- Pxe自动化安装
Centos7环境 Systemctl stop firewalld Setenforce Yum本地源 cd /etc/yum.repos.d/ 进入/etc/yum.repos.d/ Ls 查看 ...
- kickstart自动化安装
preboot execute environment预启动执行环境--intel开发的技术,计算机可以通过pxe协议从网络引导启动. 工作模式为客户端/服务器端的c/s模式 客户端从远端服务器下载镜 ...
- kickstart+pxe+tftp+ntp(http)自动化安装平台的搭建
听说过"克隆"吗,对于这个科技术语20年前可能还很陌生,羊可以克隆,通过基因dna序列:机器同样可以克隆通过网络IP! 如下为自动化安装平台: PXE(preboot execut ...
- [PXE] Linux(centos6)中PXE 服务器搭建,PXE安装、启动及PXE理论详解
[PXE] Linux(centos6)中PXE 服务器搭建,PXE安装.启动及PXE理论详解 本篇blog主要讲述了[PXE] linux(centos)PXE无盘服务器搭建,安装,启动及pxe协议 ...
随机推荐
- POJ 1456——Supermarket——————【贪心+并查集优化】
Supermarket Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit ...
- C#读写txt文件的方法
1.添加命名空间 System.IO; System.Text; 2.文件的读取 #region 读取TXT文本文件 /// <summary> /// FileStream读取文本文件 ...
- CentOS安装最新Git
1.依赖库安装 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install gcc pe ...
- 硬盘的基础知识-SSD
硬盘有三类:HDD(机械硬盘),SSD(固态硬盘),HHD(混合硬盘) 原理: HDD:磁性碟片 SSD: 闪存颗粒 HHD:磁性碟片的基础上加上了闪存颗粒. 这里对HDD,HHD不加说明,只对SSD ...
- 超详细Hexo+Github博客搭建小白教程
原文链接:超详细Hexo+Github博客搭建小白教程 去年9月的时候开始搭建了第一个自己的独立博客,到现在也稍微像模像样了.很多小伙伴应该也想过搭建一个自己的博客,网上也有一堆详细教程.我在此稍稍总 ...
- canvas绘制阴影
- ArcGIS API for JavaScript开发初探——基本地图组件使用
1.前言 在上一篇我们已经我们已经讲述了第一个地图应用程序的HelloMap的创建过程,这一篇我们来讲述基本地图组件:Home Button.比例尺.鹰眼图的使用方法. 2.基本地图组件 在ArcGI ...
- “System.OutOfMemoryException”类型的未经处理的异常在 mscorlib.dll 中发生
在VS中写程序遇到这样的问题.但数据规模小的时候不出现,但数据规模大的时候就出现.但我的电脑用32G内存.处理的文本也不是很多,在文本alignment时出错.
- webpack gulp grunt 简单介绍
本文主要是讲下webpack的相关知识点,理论比较多,因为webpack的功能非常强大,说到的也基本都是经常用到的. 这三个工具都属于前端自动化的工具,都是第三方的,并且国内很多大型团队也都有自己成熟 ...
- anaconda和jupyter notebook使用方法
查看安装的conda版本 conda --version 如果没有安装anaconda,可以从以下链接下载anaconda或者miniconda,两者安装一个就可以了 miniconda大约50M h ...