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



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!!!
:)

29 February 2008, 8:32 PM (1 year ago)report abuse Send to a friend reply

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?



29 February 2008, 8:33 PM (1 year ago)report abuse Send to a friend reply

Hamsteren:

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

29 February 2008, 8:49 PM (1 year ago)report abuse Send to a friend reply

Soofire (New user):

Had the same problem.Try this it worked for me.
peimg /inf=DRIVE:\Temp\FOLDER\*.inf /image=DRIVE:\Temp\Mount

12 November 2008, 8:26 PM (12 months ago)report abuse Send to a friend reply

Ryan:

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

29 February 2008, 8:33 PM (1 year ago)report abuse Send to a friend reply

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?

01 April 2008, 5:23 PM (1 year ago)report abuse Send to a friend reply

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

17 April 2008, 6:48 AM (1 year ago)report abuse Send to a friend reply

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

23 August 2008, 11:03 PM (1 year ago)report abuse Send to a friend reply

Hok (New user):

Hok: I have no error in injecting driver. But it failed to boot. In my Dell Latitude D630 it just boot fine because broadcom lan driver has been build in. But, in my Portege 2000, it won't boot. I have been using XP SP3 build in driver. Second I use Toshiba driver. Thirt I use latest intel 13.5 lan driver with all inf I injected. But all attempt has been failed. Can someone tell me where is the right driver for WDS Intel 855x Portege 2000? Thx.

06 January 2009, 10:25 PM (10 months ago)report abuse Send to a friend reply

Hok (New user):

Please help me find the right driver for Portege 2000 that using Intel 855x. I have been inject using build in XP SP3, Toshiba driver, Intel Pro LAN 13.5. All of it has been failed. The inject is done perfectly. The problem is when it boot, it says doen't find the driver for lan. Thank you.

06 January 2009, 10:38 PM (10 months ago)report abuse Send to a friend reply

djsmiler (New user):

I have got to the stage where i have mounted the drive and am now trying to add the image.I have managed to mount the customboot file.
my driver file e100a325.inf is in the d:\temp\drivers folder
I have typed :-
peimg /inf=D:\Temp\Drivers\*.inf /image=D:\Temp\Mount
I am now getting the foolowing error message.
No windows pe image was specified specify one with /image(path)

Please help
Cheers
Steve

21 April 2009, 7:34 PM (6 months ago)report abuse Send to a friend reply

djsmiler (New user):

I have got to the stage where i have mounted the drive and am now trying to add the image.I have managed to mount the customboot file.
my driver file e100a325.inf is in the d:\temp\drivers folder
I have typed :-
peimg /inf=D:\Temp\Drivers\*.inf /image=D:\Temp\Mount
I am now getting the foolowing error message.
No windows pe image was specified specify one with /image(path)

Please help
Cheers
Steve

21 April 2009, 7:36 PM (6 months ago)report abuse Send to a friend reply

djsmiler (New user):

Hi there I have managed to mount the image successfully.
But I am having problems trying to add the driver file to the image.
I have extracted the file e100a325.inf from the driver exe file.This has been placed in the D:\temp\drivers folder.
I have now typed the command peimg /inf=D:\Temp\Drivers\*.inf /image=D:\Temp\Mount
I am now getting the following error :-
No Windows PE image was specified:Specify one with /image(path)
use /?to display usage information

Please help as I am pulling my hair out.
Cheers

Steve

21 April 2009, 7:44 PM (6 months ago)report abuse Send to a friend reply

AdamDC (New user):

Incredibly helpful. Dell M1330 could not get an IP off of the WDS/PXE/DHCP server(s). Updated PE Boot images using your step by step instructions. Now it works! Nicely done. Thanks.

02 June 2009, 3:21 AM (5 months ago)report abuse Send to a friend reply

athornbury (New user):

I followed this example and was successful to a point when trying to use WDS to install XP 32-bit. I have an evaluation HP 8730w laptop with an Intel 82567LM ethernet controller. I am able to mount the image, inject the Vista 32-bit drivers, prep it, unmount it, and add the custom boot image to WDS. However, when I boot into the WDS PXE environment and select the custom boot image, it leaves me at the command prompt after running wpeinit. I don't know which, if any, of the commands will start the GUI for Windows PE 2.0, but the most likely candidates indicate they can't be run in a Win32 environment. Any suggestions? Thanks!

09 June 2009, 6:01 AM (5 months ago)report abuse Send to a friend reply

athornbury (New user):

I figured out my problem. While it is stated in the article that the second image in the WIM is the one to be mounted, it was:

1) Not explained why this was the case
2) Contradicted all of the examples provided by Microsoft in their help files

I found another article about injecting drivers and the answer to number 1 above is the "Boot Index:" line of the output generated using the imagex /info command. In this case, the "Boot Index:" stipulates that the second image is the one that will actually boot, not the first. Thus in my attempts to make this work, I followed the examples here and from Microsoft and used the first image not the second.

Once I made the correction, the custom WIM image worked like a charm. I was able to boot into WinPE on the HP laptop and had network connectivity.

I hope this helps someone else from pulling hair out like it did to me

11 June 2009, 6:42 AM (5 months ago)report abuse Send to a friend reply

Rob @ HomeNet (New user):

So... You said the process is the same for any WIM file and what we've done is tweak the file for WinPE, right? While WinPE is a great little tool and I'll be making a WinPE disk shortly after I write this, what about the Vista install itself? I'd like to inject a mess of drivers into the install DVD so I can not worry so much about making sure I have the motherboard disk when I show up to work on somebody's PC... So, which image (and possibly the image within the image) would I use for that?

13 June 2009, 9:22 AM (4 months ago)report abuse Send to a friend reply

newsig (New user):

"[...] but the processes for injecting extra drivers into a WIM file are exactly the same for ANY WIM-based image."

20 June 2009, 6:30 AM (4 months ago)report abuse Send to a friend reply

Rob @ HomeNet (New user):

I get it.... I already said I understood the "how." It's the "what" that I don't understand. There is BOOT.WIM and INSTALL.WIM. Both of them have images within them. Which WIM file do I want to tweak and which image inside the WIM file to I want to apply the tweaks to? I want an install disk; not just a WinPE disk.

21 July 2009, 5:18 AM (3 months ago)report abuse Send to a friend reply

anonymous user Anonymous user

This month in APC!

Tags