萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Windows Server 2003 教學

Windows Server 2008 整合網卡驅動至 WDS 開機映像 (boot.wim) 完整教學

使用 Windows Deployment Services (WDS) 進行網路部署時,用戶端在 PXE 開機階段若找不到網卡驅動,會報錯:
WdsClient: An error occurred while starting networking: a matching network card driver was not found in this image.
解決方法是將網卡驅動注入 boot.wim (Windows PE 開機映像)。本文提供兩種手動注入法與關鍵避坑指南。

前置準備

  • 安裝 Windows AIK (Windows Automated Installation Kit),取得 imagex.exe、peimg.exe (WAIK 2.0/Server 2008) 或 dism.exe (WAIK 3.0+/Server 2008 R2)。
  • 取得目標硬體的 網卡驅動程式(解壓縮後含 .inf、.sys、.cat 等檔案)。
  • 備妥 boot.wim:可從安裝光碟 \sources\boot.wim 複製,或從 WDS 伺服器匯出。

方法一:使用 peimg (Windows Server 2008 / WAIK 2.0)

  1. 建立工作目錄與掛載點:
    mkdir D:\boot
  2. 以讀寫模式掛載 boot.wim 第 2 索引(Windows PE 映像通常為索引 2):
    imagex /mountrw D:\boot.wim 2 D:\boot
  3. 注入驅動(指定 .inf 路徑):
    peimg /inf=D:\Drivers\NetAdapter\netadapter.inf D:\boot\Windows
  4. 提交變更並卸載:
    imagex /unmount /commit D:\boot
  5. 將更新後的 boot.wim 覆蓋回 WDS 伺服器 (RemoteInstall\Boot\x86\Images\boot.wim 或 x64 對應路徑)。

方法二:使用 DISM (Windows Server 2008 R2 / WAIK 3.0+,推薦)

  1. 掛載映像:
    dism /Mount-Image /ImageFile:D:\boot.wim /Index:2 /MountDir:D:\boot
  2. 新增驅動:
    dism /Image:D:\boot /Add-Driver /Driver:D:\Drivers\NetAdapter /Recurse
  3. 提交並卸載:
    dism /Unmount-Image /MountDir:D:\boot /Commit

關鍵避坑:boot.wim 雙索引皆需注入

實測發現: boot.wim 內含兩個索引(索引 1:Windows PE 2.0,索引 2:Windows Setup Engine)。僅注入索引 1 無效,必須同時注入索引 1 與 2,用戶端才能順利載入網卡驅動完成 PXE 開機。

  1. 分別掛載索引 1 與 2 到不同目錄(如 D:\boot1、D:\boot2)。
  2. 對兩個掛載點各自執行驅動注入指令。
  3. 分別提交卸載,最後以 imagex /export 或手動合併產出最終 boot.wim(或直接依序提交至同一檔案)。

驗證與後續維護

  • 在 WDS 管理主控台 → 開機映像 → 右鍵映像 → 內容 → 驅動程式 索引標籤,確認網卡驅動已列入。
  • 測試 PXE 開機:用戶端應能取得 IP、連線 WDS 伺服器、下載安裝映像。
  • 新增硬體型號時,重複上述流程更新 boot.wim,建議建立驅動庫集中管理。

常見問題

Q: 注入驅動後仍找不到網卡?
A: 確認驅動為 Windows Server 2008 / Vista 核心 (NT 6.0) 相容,舊版 XP/2003 驅動無法在 WinPE 2.x/3.x 載入。檢查 .inf 中 Signature="$Windows NT$" 與 Class=Net。
Q: x64 開機映像需注入 x64 驅動,x86 映像需 x86 驅動,不可混用。
A: 嚴格區分架構,x64 PE 無法載入 x86 驅動。
Q: 使用 DISM 時提示 0x800f081e?
A: 驅動未簽章或簽章不受信任,可加入 /ForceUnsigned(僅測試環境)或匯入憑證至信任根憑證機構。
copyright © 萬盛學電腦網 all rights reserved