Linux配置PXE啟動WinPE環(huán)境_Linux教程
PXE Server就是DHCP+TFTP服務(wù),如果想使用Server上的文件,可以加入FTP或Samba等服務(wù)。作者用經(jīng)常用的是PXE啟動WinPE環(huán)境,在Linux 中再加入Samba服務(wù)。WinPE中用 net use 把共享映射到WinPE下。就可以使用Server上的文件了。
下面Linux PXE是我在VirtualBox上RHEL6系統(tǒng)上配置的。
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配置文件內(nèi)容:紅色方框中的參數(shù)是必須的,一個都不能少。

2.配置Linux下的tftp Server
(1)創(chuàng)建remap文件,/tftpboot/tftpd.remap。該文件內(nèi)容如下:
必須加入這一行: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的配置內(nèi)容:

3.啟動各服務(wù)
#service dhcpd restart
#service xinetd restart
4.創(chuàng)建BCD啟動文件(摘自微軟官方)
在此步驟中,將使用 BCDEdit 工具創(chuàng)建 BCD 存儲。BCDEdit 工具只能在 Windows7 計算機(jī)或 Windows PE 環(huán)境中運行。BCDEdit 工具位于 \Windows\System32 目錄中。
1.在 Windows® 7 計算機(jī)或 Windows PE 環(huán)境中,使用 BCDEdit 工具創(chuàng)建一個 BCD 存儲。例如,
Bcdedit -createstore c:\BCD
2.創(chuàng)建 RAMDISK 設(shè)置。例如,
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.(可選)創(chuàng)建內(nèi)核調(diào)試程序設(shè)置。例如,
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 映射創(chuàng)建 OSLoader 設(shè)置。例如,
Bcdedit -store c:\BCD -create /d "MyWinPE Boot Image" /application osloader 如果 s 命令成功,則計算機(jī)將返回 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.創(chuàng)建 BOOTMGR 設(shè)置。例如,
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 文件條目對應(yīng)的 GUIDS。
我所使用的BCDEDIT命令如下:我把創(chuàng)建出來的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
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 /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%
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文件中的內(nèi)容:
還可以做成多啟動,例如WinPE 32BIT和WinPE 64BIT。只需要用BCDEDIT命令修改BCD文件即可。網(wǎng)有很多說要修改bootmgr.exe文件的二進(jìn)制內(nèi)容,又說要去掉其中的MD5驗證功能等,都是錯誤的,根本不用那么麻煩。我們只需要修改BCD文件就可以了。而Windows中提供了一個非常強(qiáng)大的命令來修改它,就是BCDEDIT這個命令。
5.把WINPE3.0文件放到Linux TFTP Server /tftpboot 目錄下。
創(chuàng)建Boot目錄
#Mkdir /tftpboot/Boot
把BCD、boot.sdi、boot.wim、front目錄放到 /tftpboot/Boot/ 目錄
把pxeboot.0、bootmgr.exe、tftpd.remap放到 /tftpboot/ 目錄
其中tftpd.remap這個文件非常重要,這是把windows下的“\”映射成Linux下的“/”,否則在加載BCD文件的時候就會出錯,出現(xiàn)找不到BCD文件的提示。
下圖是我的/tftpboot/目錄下的內(nèi)容:

從網(wǎng)絡(luò)啟動,啟動畫面如下:
至于WinPE3.0如何制作,這種簡單的問題就不用說了,用AIK或OPK就可以制作一個干凈的WinPE了。bootmgr.exe/boot.sdi/boot.wim/pxeboot.0可以從AIK或OPK中獲得。其中pxeboot.0就是pxebootn12.com的改名。
相關(guān)Linux教程:
- Linux系統(tǒng)下TOP命令使用與分析詳解
- 安裝Linux我們需要改變20件事情
- 使用Linux系統(tǒng)架設(shè)VSFTP服務(wù)器
- Linux系統(tǒng)上架設(shè)POP3服務(wù)器
- Linux中“Networking Disabled”的解決方法(解決Ubuntu等系統(tǒng)無法上網(wǎng))
- ubuntu系統(tǒng)清理磁盤教程
- linux下搭建pxe自動化安裝環(huán)境
- BIOS不支持導(dǎo)致Linux內(nèi)核耗電增加
- Debian GNU/Linux系統(tǒng)卡片
- Linux操作系統(tǒng)開機(jī)自行啟動項目詳細(xì)解析
- Linux菜鳥入門級命令大全
- Linux操作系統(tǒng)中讀取目錄文件信息的過程
Linux教程Rss訂閱服務(wù)器教程搜索
Linux教程推薦
猜你也喜歡看這些
- 介紹IIS環(huán)境下ASP程序不能瀏覽的解決方法
- 如何加固外網(wǎng)上的IIS服務(wù)器的安全
- 使用負(fù)載均衡技術(shù)建設(shè)高負(fù)載的網(wǎng)絡(luò)站點(3)
- windows服務(wù)器詳細(xì)安全設(shè)置
- Windows安全認(rèn)證是如何進(jìn)行的?[Kerberos篇]
- 個人服務(wù)器架設(shè)全攻略(90)
- 如何有效建立Win2000 VPN服務(wù)器
- win2003中的w3wp.exe進(jìn)程大量占用cpu資源的各種問題解決方法
- 給IIS Web服務(wù)器裝上一把鎖(3)
- Apache 性能最優(yōu)化分析(7)
- 相關(guān)鏈接:
- 教程說明:
Linux教程-Linux配置PXE啟動WinPE環(huán)境
。