HOW TO: inject drivers into Microsoft's free OS, Windows PE 2.0

Send to a friend Print

Help more people find out about this story

Del.icio.us
StumbleUpon

James Bannan14 March 2007, 10:08 AM

Did you know there's a super-stripped-down version of Windows available for free download from Microsoft? Windows PE 2.0 is great for system recovery and imaging tasks, but it comes with rather a small set of drivers. Here's how to upgrade it with more drivers of your own.


We've covered it before, but it's worth taking another look at the little-known version of Windows that is used to run the Windows Vista installation process: Windows PE 2.0.

It's available as a standalone, streamlined operating system which is incredibly helpful for all sorts of other things, like system recovery and imaging.

It's a highly stripped-back version of Vista that you can download free of charge as part of the Windows Automated Installation Kit (WAIK) -- here's an article we did last year on how to install and use it.

Since those earlier articles, a couple of questions have sprung up about how to use the available tools to modify Windows PE-based boot images.

This is a pretty important issue, because Windows PE is also used for the Windows Distribution System (WDS), Microsoft's new software for deploying Vista across a large number of PCs via a network. Since WDS, by its nature, must work across various hardware platforms, it probably needs more drivers than the smallish set that comes with it.

This can cause problems, some of which I encountered in two different imaging scenarios - a virtual client loaded the boot image but I was told that there was no support for the network card (a definite problem for a network installation!) and another client with an nForce-based motherboard that simply bluescreened, due to lack of appropriate system and SATA/IDE drivers.

Here's how to get around the problem.

HOW TO: Inject Drivers into Windows PE 2.0

This tutorial assumes that you’re running Windows Deployment Services and want to update the default BOOT.WIM file to enhance platform compatibility, but the processes for injecting extra drivers into a WIM file are exactly the same for ANY WIM-based image.

You’ll need a full install of the WAIK, as it contains the necessary tools to manage WIM files. This can be done on any system, but if you’re running WDS it will install properly on the WDS server. Insert the DVD and select “Windows AIK Setup” and install WAIK.

WAIK InstallWAIK Install

Next you’ll need to create a folder to easily modify BOOT.WIM. I found it easiest to create a Temp folder, and then two more folders within that called Mount and Drivers. Then copy BOOT.WIM from the Vista DVD to the TEMP folder and rename it CUSTOMBOOT.WIM.

Now download the drivers you need, and extract them to \Temp\Drivers.

You’re not after DOS drivers – remember that this is Windows PE 2.0 so XP drivers are the best ones to use (or Windows Vista, if they’re available).

WinRAR is a great tool for extracting the contents of an EXE while maintaining the folder structure – this is very important as you need to be able to get at the INF driver files.

Once that’s done, go to the Start Menu, Microsoft Windows AIK, Windows PE Tools Command Prompt. This loads a command window with the PE tools IMAGEX, PEIMG and OSCDIMG loaded into the path, which makes life much easier.

PE Tools Command PromptPE Tools Command Prompt

Navigate to \Temp and type in:

imagex /info DRIVE:\Temp\customboot.wim


Where DRIVE is the appropriate drive letter. This checks the CUSTOMBOOT.WIM file and lists the images contained within it.

ImageX InfoImageX Info

There are actually two images, but the one we want is the Longhorn Setup image – number 2. Now type in:

imagex /mountrw DRIVE:\Temp\customboot.wim 2 DRIVE:\Temp\Mount

This mounts image 2 of CUSTOMBOOT.WIM into the \Temp\Mount folder in read/write mode. You can navigate to this folder and browse the contents and make any changes you like.

PE Tools - Mount ImagePE Tools - Mount Image

Now go back to the command window and type in:

peimg /inf=DRIVE:\Temp\Driver\FOLDER\*.inf /image=DRIVE:\Temp\Mount

Where FOLDER is the appropriate folder which contains the INF driver files. This injects the drivers straight into the mounted image. You can manually specify which driver is to be installed, or just use the wildcard to install all the drivers found in that folder. Repeat this process for all the drivers you want to install.

PE Tools - Inject DriversPE Tools - Inject Drivers

Once that’s done, type in:

imagex /unmount /commit DRIVE:\Temp\Mount

This unmounts the image from the \Temp\Mount folder and commits the changes you made. Do NOT forget the /commit statement or you’ll have to do the whole thing all over again. Not fun.

Now go back to the WDS console and right-click on the boot image, then select Disable. Right-click again and select Replace Image, then browse to \Temp\CUSTOMBOOT.WIM. This will replace the contents of BOOT.WIM with the updated CUSTOMBOOT.WIM. It doesn’t erase BOOT.WIM, and the boot image will still use the original file, but the extra drivers are now loaded into the Longhorn Setup image. Being able to replace the image means that you can maintain an offline master boot image, so you never need to directly work with the WDS boot image.

Unlike RIS where any such change required a restart of the service, WDS accepts this change on the fly. Connect your clients to the WDS server and they will use the updated setup image with the incorporated drivers. In my setup, both problematic platforms worked perfectly with the custom boot image.

Related articles



Post your comment



Reader Comments

RSS feed Email alert

Rik:

Very Handy tip, James, thanks!

...and if you just have a single home PC with an OEM "Vista 64-bit", same as above except (after you've copied your entire OEM DVD to a directory) you'll do it to your ...\sources\boot.wim, and just re-create your new Master OEM DVD with:
For Exmaple, if (OEM)DVD was copied to
D:\DVD
(still being in PE Command Tools...)
cd
c:\Program Files\Windows AIK\Tools\PETools

oscdimg -n -m -b"%Programfiles%\Windows AIK\Tools\PETools\amd64\boot\etfsboot.com" D:\DVD D:\NewVista64.iso

Finally, just burn the new .iso file with your favourite 3rd party image burner.

-and look Ma, no more "....CD/DVD required device drivers missing..." again!!!
:)

Rubusto:

I have followed these instructions to a "T" and everything has worked great until I get to the command to injects the drivers: "peimg /inf=DRIVE:\Temp\Driver\FOLDER\*.inf /image=DRIVE:\Temp\Mount"

Everytime I attempt this I get this message: "More that one Windows PE image path was specified with /image"

Any ideas?



Hamsteren:

Your missing the imagex /info xxx.wim to see which "image" in the wim file you should mount ;)

Ryan:

I keep getting the error code 0x80070003 when trying to inject the drivers. It mounts fine but won't inject. Any Ideas?

gorlaz (New user):

I've added my network driver per the steps above and it seemed to work ok, but I still get an error;
WdsClient: An Error occurred while starting networking: a matching network card driver was not hound 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

Has anyone else got this?

Jan (New user):

Hello, I had a same problem with error 0x80070000 and 0x80070002
result is: copy to folder \Ethernet all files from install media for your ethernet card (inf, cat and other files) and paste name of .inf file from your ethernet folder
Example:
inf=C:\Temp\Driver\Ethernet\nvnetbus.inf /image=C:\Temp\Mount

FarisNT (New user):

HI ...The problem is the test is also running over a VMWare
But I can not find the driver for VMware 6
I use a third party software .. but the same problem

anonymous user Anonymous user

This month in APC

Best-value iPhone plans

Tags