在linux上运行winpe,Linux配置PXE Server启动WinPE3.0环境
PXE Server就是DHCP+TFTP服务,如果想使用Server上的文件,可以加入FTP或Samba等服务。我用经常用的是PXE启动WinPE环境,在Linux 中再加入Samba服务。WinPE中用 net use 把共享映射到WinPE下。就可以使用Server上的文件了。
下面Linux PXE是我在VirtualBox上RHEL6系统上配置的。
1.配置Linux DHCP Server
以下是dhcpd.conf配置文件:这里只是简单给出必须的配置项。
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.56.254;
filename "pxeboot.0";
}
subnet 192.168.56.0 netmask 255.255.255.0 {
option routers 192.168.56.1;
range dynamic-bootp 192.168.56.10 192.168.56.250;
default-lease-time 600;
max-lease-time 7200;
}
下图是我的DHCP配置文件内容:红色方框中的参数是必须的,一个都不能少。
2.配置Linux下的tftp Server
(1)创建remap文件,/tftpboot/tftpd.remap。该文件内容如下:
必须加入这一行:rg \\ /
(2)编辑/etc/xinitd.d/tftp文件。
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -u nobody -s /tftpboot -m /tftpboot/tftpd.remap -vvv
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
下图是我的xinitd方式启动TFTP的配置内容:
3.启动各服务
#service dhcpd restart
#service xinetd restart
4.创建BCD启动文件(摘自微软官方)
在此步骤中,将使用BCDEdit 工具创建 BCD 存储。BCDEdit 工具只能在 Windows7 计算机或 Windows PE 环境中运行。BCDEdit 工具位于 \Windows\System32 目录中。
1.在Windows® 7 计算机或 Windows PE 环境中,使用 BCDEdit 工具创建一个 BCD 存储。例如,
Bcdedit -createstore c:\BCD
2.创建RAMDISK 设置。例如,
Bcdedit -store c:\BCD -create {ramdiskoptions} /d "Ramdisk options"
Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdidevice boot
Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
3.(可选)创建内核调试程序设置。例如,
Bcdedit -store c:\BCD -create {dbgsettings} /d "Debugger settings"
Bcdedit -store c:\BCD -set {dbgsettings} debugtype serial
Bcdedit -store c:\BCD -set {dbgsettings} baudrate 115200
Bcdedit -store c:\BCD -set {dbgsettings} debugport 1
4.为Windows PE 映射创建 OSLoader 设置。例如,
Bcdedit -store c:\BCD -create /d "MyWinPE Boot Image" /application osloader 如果s 命令成功,则计算机将返回 GUID 值。下列示例将此值指代为 guid1。
Bcdedit -store c:\BCD -set {guid1} systemroot \Windows
Bcdedit -store c:\BCD -set {guid1} detecthal Yes
Bcdedit -store c:\BCD -set {guid1} winpe Yes
Bcdedit -store c:\BCD -set {guid1} osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
Bcdedit -store c:\BCD -set {guid1} device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
5.创建BOOTMGR 设置。例如,
Bcdedit -store c:\BCD -create {bootmgr} /d "Windows BootManager" /inherit {dbgsettings}
Bcdedit -store c:\BCD -set {bootmgr} timeout 30
Bcdedit -store c:\BCD -displayorder {guid1} {guid2}
其中,guid1、guid2 等等是每个 .wim 文件条目对应的 GUIDS。
我所使用的BCDEDIT命令如下:我把创建出来的BCD文件保存在D:\BCD这个目录下。
bcdedit /createstore d:\BCD\BCD
bcdedit /store D:\BCD\BCD /create {ramdiskoptions} /d "Ramdisk options"
bcdedit /store D:\BCD\BCD /set {ramdiskoptions} ramdisksdidevice boot
bcdedit /store D:\BCD\BCD /set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
bcdedit /store D:\BCD\BCD /create /d "WinPE 3.0 32bit" /application osloader 得到ID
set id={ac1ab259-21dd-11e0-aee8-b8ac6fc4f993} 例如是这个ID
bcdedit /store D:\BCD\BCD /set %id% systemroot \windows
bcdedit /store D:\BCD\BCD /set %id% detecthal Yes
bcdedit /store D:\BCD\BCD /set %id% winpe Yes
bcdedit /store D:\BCD\BCD /set %id% osdevice ramdisk=[boot]\Boot\boot32.wim,{ramdiskoptions}
bcdedit /store D:\BCD\BCD /set %id% device ramdisk=[boot]\Boot\boot32.wim,{ramdiskoptions}
bcdedit /store D:\BCD\BCD /create {bootmgr} /d "Windows Boot Manager"
bcdedit /store D:\BCD\BCD /set {bootmgr} nointegritychecks yes
bcdedit /store D:\BCD\BCD /set {bootmgr} timeout 0
bcdedit /store D:\BCD\BCD /default %id%
bcdedit /store D:\BCD\BCD /displayorder %id%
下图是我的BCD文件中的内容:
还可以做成多启动,例如WinPE 32BIT和WinPE 64BIT。只需要用BCDEDIT命令修改BCD文件即可。网有很多说要修改bootmgr.exe文件的二进制内容,又说要去掉其中的MD5验证功能等,都是错误的,根本不用那么麻烦。我们只需要修改BCD文件就可以了。而Windows中提供了一个非常强大的命令来修改它,就是BCDEDIT这个命令。
5.把WINPE3.0文件放到Linux TFTP Server /tftpboot 目录下。
创建Boot目录
#Mkdir /tftpboot/Boot
把BCD、boot.sdi、boot.wim、front目录放到 /tftpboot/Boot/ 目录
把pxeboot.0、bootmgr.exe、tftpd.remap放到 /tftpboot/ 目录
其中tftpd.remap这个文件非常重要,这是把windows下的“\”映射成Linux下的“/”,否则在加载BCD文件的时候就会出错,出现找不到BCD文件的提示。
下图是我的/tftpboot/目录下的内容:
从网络启动,启动画面如下:
至于WinPE3.0如何制作,这种简单的问题就不用说了,用AIK或OPK就可以制作一个干净的WinPE了。bootmgr.exe/boot.sdi/boot.wim/pxeboot.0可以从AIK或OPK中获得。其中pxeboot.0就是pxebootn12.com的改名。
以后有时间我会把这部份完善。
在linux上运行winpe,Linux配置PXE Server启动WinPE3.0环境相关推荐
- 在Linux上安装Gearman及配置使用Gearman的PHP扩展环境
在Linux上安装Gearman及配置使用Gearman的PHP扩展环境. 先介绍安装 Gearman . 1. 先安装依赖库 # yum install -y boost-devel gperf l ...
- c#在linux上运行,在Linux上运行C#的方法
本文实例讲述了在Linux上运行C#的方法.分享给大家供大家参考.具体方法如下: 在任何一个平台(操作系统+硬件体系)上,编写和运行程序的三个最根本的需求是库.编译器/解释器.运行环境.库以类和方法( ...
- linux上运行gfortran,linux – gfortran:在64位系统中编译32位可执行文件
我在AMD Athlon(tm)64 X2双核处理器5200×2上运行Ubuntu 12.10(64位), Linux内核3.5.0-51通用.我有GNU Fortran(Ubuntu / Linar ...
- 在linux上运行flutter,Linux中配置Flutter环境
我是在Linux系统下配置Flutter环境的,具体操作步骤如下: 在flutter官网下载Linux 最新版的flutter_sdk,这里我没有下载最新版本的,导致用Android Studio 构 ...
- linux上运行gfortran,linux下gfortran 生成so文件
转自:http://blog.sciencenet.cn/blog-725052-1146332.html Fortran 90增加了Module的功能,可用来替代common data,打包子程序. ...
- windows编译生成在linux上运行,在linux上编译windows 32/64 上运行的vlc
Windows-32位 1,GCC版本信息 #gcc -v Using built-in specs. Target: i686-linux-gnu gcc version 4.4.5 (Ubuntu ...
- 在linux上运行python脚本(安装pytorch踩坑记录,pyinstaller使用方式,构建docker镜像)
背景 脚本需要导入pytorch等库才能运行. 脚本在windows上运行成功,尝试放到linux上运行. linux服务器内存较小. 方法一:在linux上安装依赖 把脚本放到linux上,直接安装 ...
- Docker在Linux上运行NetCore系列(一)配置运行DotNetCore控制台
Docker在Linux上运行NetCore系列(一)配置运行DotNetCore控制台 原文:Docker在Linux上运行NetCore系列(一)配置运行DotNetCore控制台 转发请注明此文 ...
- linux里运行windows,在Linux上运行Windows应用程序
当前位置:我的异常网» Linux/Unix » 在Linux上运行Windows应用程序 在Linux上运行Windows应用程序 www.myexceptions.net 网友分享于:2015- ...
最新文章
- div+css实现表头固定内容滚动表格
- flowable 配置自定义表单_Flowable用代码自定义流程
- 就业模拟试题_Net(答案)
- dubbo学习(四)配置dubbo 注解方式配置
- 用java编程实现集合的交、并、差和补运算
- vm 安装jdk1.8_JDK 13:VM.events已添加到jcmd
- 啊哈c语言推箱子小游戏,啊哈C入门版学完了,现发推箱子源代码~
- JAVA开发工具下载
- C#使用Sockets操作FTP【转载】
- matlab 防雷硒堆,单相全控桥式晶闸管整流电路的设计(阻感负载)电力电子课程设计...
- Bash shell脚本打印出正在执行的命令
- Python补充03 Python内置函数清单
- 解析网页(KMP算法实现部分)
- 置换群burnside引理(bzoj 1004: [HNOI2008]Cards)
- 问题三十二:怎么用ray tracing画多边形(polygon, triangle)
- ES6、7学习笔记(尚硅谷)-5-箭头函数
- 求最大李雅普诺夫指数(Largest Lyapunov Exponents,LLE)的 Rosenstein 算法
- html内嵌式的语言,html嵌入窗口
- 软件测试 - 软件测试流程(完整版)避免当背锅侠,测试人的生存......
- pip install pygame_Python、PyGame游戏项目