国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Linux服務器 > 正文

Linux配置PXE啟動WinPE環境

2024-09-05 23:01:19
字體:
來源:轉載
供稿:網友
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配置文件內容:紅色方框中的參數是必須的,一個都不能少。

Linux配置PXE啟動WinPE環境

 
2.配置Linux下的tftp Server
(1)創建remap文件,/tftpboot/tftpd.remap。該文件內容如下:
必須加入這一行:rg // /
Linux配置PXE啟動WinPE環境
 
(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的配置內容:

Linux配置PXE啟動WinPE環境

 
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文件中的內容:

Linux配置PXE啟動WinPE環境 

還可以做成多啟動,例如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/目錄下的內容: 

Linux配置PXE啟動WinPE環境

 

從網絡啟動,啟動畫面如下:

Linux配置PXE啟動WinPE環境 

 

至于WinPE3.0如何制作,這種簡單的問題就不用說了,用AIK或OPK就可以制作一個干凈的WinPE了。bootmgr.exe/boot.sdi/boot.wim/pxeboot.0可以從AIK或OPK中獲得。其中pxeboot.0就是pxebootn12.com的改名。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 双江| 通河县| 新蔡县| 茂名市| 南昌县| 友谊县| 天台县| 吉水县| 准格尔旗| 丰台区| 新巴尔虎左旗| 兴隆县| 宣恩县| 浮梁县| 桃江县| 西藏| 抚顺市| 华蓥市| 同德县| 徐水县| 南开区| 望都县| 烟台市| 金堂县| 西城区| 抚宁县| 浪卡子县| 嘉黎县| 镶黄旗| 获嘉县| 新干县| 塘沽区| 凤山市| 琼结县| 盐津县| 泰宁县| 梧州市| 开江县| 蓬溪县| 商洛市| 衡阳市|