栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

vmware 测试pxe网络启动安装系统

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vmware 测试pxe网络启动安装系统

1.安装台pxe机器 1.关闭防火墙、关闭selinux、安装dhcp、tftp、httpd、syslinux
yum install -y httpd tftp-server dhcpd
2.配置dhcp服务
subnet 192.168.247.0 netmask 255.255.255.0 {
  range 192.168.247.10 192.168.247.99;  # 地址池
  option subnet-mask 255.255.255.0;     # 子网掩码
  option routers 192.168.247.2;         # 网关
  option domain-name "example.con";     # 搜索域
  option domain-name-servers 114.114.114.114; # DNS

  default-lease-time 3600; 
  filename "pxelinux.0";   # pxe启动文件
  next-server 192.168.247.5; # 本机ip
}

vim /etc/dhcp/dhcp.conf

3.配置tftp服务器

编辑 /etc/xinetd/tftp     --------> disable  = no

重启  systemctl restart tftp

4.拷贝PXE服务器的相关文件
# 引导文件
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
# 菜单文件
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/

拷贝挂在光盘的系统文件 vmlinuz 和initrd.img 到/var/lib/tftpboot/

# 安装引导文件1
cp /mnt/isolinux/vmlinuz /var/lib/tftpboot/
# 安装引导文件2
cp /mnt/isolinux/initrd.img /var/lib/tftpboot/
5 创建pxe启动的文件
mkdir /var/lib/tftpboot/pxelinux.cfg  && touch default
vim default

default menu.c32
timeout 300
prompt 0

label 1
menu label ^1) install centos7
menu default
kernel vmlinuz
append initrd=initrd.img method=http://192.168.247.5/Centos7 ks=http://192.168.247.5/ks.cfg

制作安装的菜单文件

6. 配置web服务

将光盘文件挂在到http服务

mount  /dev/cdrom  /var/www/html/Centos7

将文件拷贝root/anaconda-ks.cfg /var/www/html/ks.cfg  进行更改

chmod +r /var/www/html/ks.cfg

vim /var/www/html/ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
# cdrom
url --url http://192.168.247.5/Centos7
# Use graphical install
#graphical
text
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --bootproto=dhcp --device=eno16777728 --ipv6=auto --activate
network  --hostname=localhost.localdomain

# Root password
rootpw --iscrypted $6$ZueDaq6Rviw1ROWs$a7hxyqvtB48pFO5gLoqJxEAWWU4eCVhs77rt.2uJe1zk8pGTWDs2mSci3vkQLsGofWhoeJqkbzxnntEdD7xuV.
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
#clearpart --none --initlabel
clearpart --all --initlabel

%packages
@^minimal
@core
kexec-tools

%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end
reboot

配置vmware关闭网卡的dhcp

 重启所有服务

systemctl restart httpd tftp-server dhcpd
二、测试新建虚拟机

 

 

 启动

 可以进行安装

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/512424.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号