一、 环境说明:
客户端:CPU:双核 内存:4GB 内存 80GB ip地址:DHCP
服务端1:CPU:双核 内存:1GB 内存 20GB ip地址:192.168.40.254 设备标识:Centos7 X64
服务端2:CPU:四核 内存:8GB 内存 120GB ip地址:172.16.20.200 设备标识:Windows7 X64
网络端:CPU:四核 内存:4GB 内存 80GB ip地址:192.168.40.1 设备标识:软路由
二、 安装步骤
准备WinPE镜像
服务端2在网站上自行下载Windows Automated Installation Kit工具
下载链接:https://www.microsoft.com/en-us/download/details.aspx?id=5753
安装这个工具之前需要注意:启用windows7 X64--Windows功能—启用或关闭Windows功能---勾选”.NET Framerwork 3.5(包含2.0和3.0)”—点击确定
用bandzip解压缩工具解压出来ISO压缩包,然后执行StartCD.exe,并如下图所示安装软件:
之后就是一直next----next-----done的节奏
键盘win键调出开始菜单,然后以管理员执行如下程序,并且执行以下命令
copype amd64 C:\winPE_amd64
copy "C:\Program Files\Windows AIK\Tools\PETools\amd64\winpe.wim" C:\winpe_amd
64\ISO\Sources\Boot.wim
copy "C:\Program Files\Windows AIK\Tools\amd64\Imagex.exe" C:\winpe_amd64\ISO\
oscdimg -n -bC:\winpe_amd64\etfsboot.com C:\winpe_amd64\ISO C:\winpe_amd64\winpe_amd64.iso
制作完成后,将做好的镜像文件保存,备用:镜像文件存储位置----C:\winpe_amd64\winpe_amd64.iso
准备Windows7原版镜像
去https://msdn.itellyou.cn/ 下载你喜欢的windows7系统即可,然后备用:cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso
服务端1搭建前环境优化
关于镜像上传服务器:
下载rz、sz工具并且配合Xshell或者SecureCRT软件进行文件上传下载功能:
rz、sz工具下载:yum –y install lrzsz
使用rz命令进行上传客户端操作
[root@localhost ~]# cd /
[root@localhost /]# ls
bin dev home lib media opt root sbin sys usr
boot etc lib64 mnt proc run srv tmp var
[root@localhost /]# mkdir /windows
[root@localhost /]# mkdir /iso
[root@localhost /]# cd /iso
[root@localhost iso]# rz
开始 zmodem 传输。 按 Ctrl+C 取消
[root@localhost iso]# ls
cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso
挂在镜像:
[root@localhost iso]# mount -o loop /iso/cn_windows_
7_enterprise_with_sp
1_x
64_dvd_u_
677685.iso /mnt/
挂载的文件全部复制到共享目录 /windows:
[root@localhost / ]# cp -rf /mnt/* /windows/
[root@localhost / ]# cd /windows
[root@localhost windows]# ls
autorun.inf bootmgr efi sources upgrade
boot bootmgr.efi setup.exe support
关于PXE服务器环境优化:
临时关闭SELinux并且关闭防火墙
[root@localhost windows]# systemctl stop firewalld
[root@localhost windows]# setenforce 0
下载dhcp
[root@localhost windows]# yum –y install dhcp
设置dhcp服务器
[root@localhost windows]# vim /etc/dhcp/dhcpd.conf
设置:
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.40.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.40.200 192.168.40.250;
option broadcast-address 192.168.40.255;
option routers 192.168.40.1;
option subnet-mask 255.255.255.0;
next-server 192.168.40.254;
filename "pxelinux.0";
}
从上而下解释:
设置dhcp服务器网段和子网掩码,再设置ip地址动态范围,设置广播地址,设置路由地址,设置子网掩码,设置tftp服务器地址,最后设置下bootlocader文件名
启动dhcp服务并纳入开机自启
[root@localhost windows]# systemctl enable dhcp && systemctl start dhcp
下载tftp
[root@localhost windows]# yum –y install tftp
设置tftp服务器(简单文本传输)
[root@localhost windows]# vim /etc/xinetd.d/tftp
设置:
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
将disable=yes改为disable=no 意思是启用tftp
启动tftp服务并纳入开机自启
[root@localhost windows]# systemctl enable xinetd && systemctl start xinetd
查询tftp状态:
[root@localhost windows]# netstat -a| grep tftp
udp6 0 0 [::]:tftp [::]:*
[::]:*
安装
[root@localhost windows]# yum -y install syslinux
将pxelinux0、memdisk、menu.c32复制到tftp默认共享目录
[root@localhost windows]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@localhost windows]# cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
[root@localhost windows]# cp /usr/share/syslinux/memdisk /var/lib/tftpboot/
创建默认的pxe启动配置菜单,winpe_amd64.iso是windows7_x64的pe镜像
[root@localhost windows]# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@localhost windows]# vim /var/lib/tftpboot/pxelinux.cfg/default
UI menu.c32
label 1
menu label ^1) Install Windows 7 x64
KERNEL memdisk
INITRD winpe_amd64.iso
APPEND iso raw
将WinPE镜像上传到PXE服务器上
[root@localhost windows]# cd /var/lib/tftpboot
[root@localhost tftpboot]# rz
[root@localhost tftpboot]# ls
memdisk menu.c32 pxelinux.0 pxelinux.cfg winpe_amd64.iso
[root@localhost tftpboot]# cd /windows
安装
[root@localhost windows]# yum -y install samba
[root@localhost windows]# vim /etc/samba/smb.conf
[global]
workgroup = PXESERVER
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
idmap config * : backend = tdb
cups options = raw
netbios name = pxe
map to guest = bad user
dns proxy = no
public = yes
## For multiple installations the same time - not lock kernel
kernel oplocks = no
nt acl support = no
security = user
guest account = nobody
[install]
comment = Windows 7 Image
path = /windows
read only = no
browseable = yes
public = yes
printable = no
guest ok = yes
oplocks = no
level2 oplocks = no
locking = no
验证配置文件并且启动服务
[root@localhost windows]# testparm
[root@localhost windows]# systemctl start smb && systemctl enable start
在服务端2查看服务状态:
开始安装
进入winpe命令行,挂载smb共享,并开始安装windows7系统
命令备注:
net use z: \\192.168.40.254\install
setup.exe
发现已经可以进行手动安装了。
手机扫一扫
移动阅读更方便
你可能感兴趣的文章