How to inject drivers on WIM images
When dealing with Windows deployments on large complex environments, tools like Windows Automated Kit (AIK), Windows Deployment Services (WDS) and Microsoft Deployment Tools (MDT) should be part of your basic toolkit. If you have dealt with that, you should know that boot.WIM images doesn’t have all necessary drivers to let Microsoft Windows Setup do its job and deploy the configured installation image.
If you fall into this situation the message below will pop-up on your screen:
WdsClient: An error occurred while starting networking: a matching network card driver was not found in this image. Please have your Administrator add the network driver for this machine to the Windows PE image on the Windows Deployment Services server.
To address this situation, drivers need to be injected on your WDS or Windows PE boot image. Deployment Image Servicing and Management (DISM) installs, uninstalls, configures, and updates the features and packages in offline Windows images and offline Windows Preinstallation Environment (Windows PE) images. The commands and options that are available for servicing an image depend on which Windows operating system you are servicing (Windows 7, Windows Vista with Service Pack 2 (SP2), Windows Vista with Service Pack 1 (SP1), Windows Server 2008 R2, Windows Server 2008, or Windows PE), and whether the image is offline or a running operating system. All commands work on an offline Windows image.
Note that PEimg.exe tool has been discontinued by Microsoft and now you need to use DISM tool to inject drivers on WIM images.
How to do it?
-
Download the required NIC drivers. Note that signed drivers are mandatory for Windows 7 x64.
-
Mount the image to an empty directory.
_DISM /Mount-Wim /wimfile:\boot.WIM /index:1 /MountDir:
-
Add the drivers to the image:
_DISM /image: /add-driver:\.INF
-
Unmount and commit the changes:
_DISM /unmount-wim /mountdir: /commit
You need to repeat steps above for every product contained on the image you are modifying. In this particular example, you need to repeat this step with /index:2 to inject drivers to Microsoft Windows Setup product contained on the boot.WIM image.
You can get the Index value for every product contained on the image by typing:
DISM /Get-WimInfo /WimFile:\boot.WIM
You can find more information on Deployment Image Servicing and Management Command-Line Options in Microsoft’s TechNet center.