Maintain Driver Configurations when Capturing a Windows Image

A common deployment scenario is to capture a single Windows® image from a reference computer and then apply the image to a group of destination computers that have identical hardware configurations.

To save time during installation and to speed up the out-of-box experience (OOBE) for end users, you can instruct Windows Setup to maintain the driver configurations from the reference computer as part of the Windows image. You should do this only when the hardware on the reference computer and the hardware on the destination computers are identical. When you do this, Windows Setup maintains driver configurations during image capture and deployment.

The Windows 8 and Windows Server® 2012 in-box driver packages include device drivers that support a wide variety of popular hardware. If your specific hardware requires additional device drivers to boot, you can preinstall additional device drivers on your Windows image. Independent Hardware Vendors (IHVs) often supply these additional device drivers together with their device hardware. For more information about how to add device drivers, see Add a Driver Online in Audit Mode.

To prepare a Windows image for deployment to multiple computers, you must use the System Preparation (Sysprep) tool to generalize the Windows image. Generalizing a Windows image removes the computer-specific information and prepares the device drivers for first boot. This preparation includes these steps:

Device state for hardware is removed.

Boot-critical driver settings are reset to their default values.

Device log files are deleted.

When you generalize the computer, use an answer file that has the Microsoft-Windows-PnpSysPrep\PersistAllDeviceInstalls setting to save time. This setting prevents Windows Setup from removing and reconfiguring the device state for identical hardware. On first boot, the detected device drivers are already preconfigured, potentially enabling a quicker first-boot experience.

Important

Avoid using the PersistAllDeviceInstalls setting when the hardware and the hardware configuration on the reference computer are not identical to those of the destination computers. Even seemingly minor differences in hardware or hardware configuration can cause severe or easily overlooked problems. For more information, see the Troubleshooting Hardware Configuration Differences section of this topic.

It's a good practice not to use the PersistAllDeviceInstalls setting on your primary reference image. Instead, for each group of computers that have a different hardware configuration, first load your primary reference image onto a new reference computer that has the planned hardware configuration. Next, capture a new image of this setup and use the PersistAllDeviceInstalls setting.

Don't maintain multiple versions or revisions of the same driver package in the same image. Use offline or online servicing tools to update drivers.

Normally, when Windows Setup boots a computer and multiple versions of a driver package exist on that computer, Setup determines which driver to install by using driver ranking. But when you use the PersistAllDeviceInstalls setting, the normal driver-ranking processes don't occur. So, devices that use outdated drivers may remain installed. For more information about driver ranking, see How Windows Ranks Drivers on MSDN®.

If you must add a device driver to an image that uses the PersistAllDeviceInstalls setting, you can update your device drivers by using one of the following methods:

For the PersistAllDeviceInstalls setting to work correctly, the hardware configuration must be identical on the reference computer and on the destination computers. Hardware configuration includes the following components:

Hardware make and model.

Firmware. Updates, revisions, and configuration differences can cause some devices to report different criteria for matching device drivers or to use different resources. For example:

BIOS revisions can change the Advanced Configuration and Power Interface (ACPI) namespace. This causes Windows Setup to report existing devices differently or to introduce existing devices as new devices.

When the boot-critical hardware is not identical on the reference computer and destination computers, using the PersistAllDeviceInstalls setting can cause severe system problems that can leave the computer in a non-bootable state.

Boot-critical driver packages can belong to any of the following Windows 8 or Windows Server 2012 device setup classes, as identified by the ClassGUID directive in the <Version> section of the .inf files in their driver packages.

When you deploy a new computer to an end user, some hardware, like a removable device or a device that has an on/off switch, may not be present or detected during first boot. By default, on first boot, Windows Setup removes the preconfigured device state for undetected hardware.

To deploy hardware that may not be present or detected on first boot, add any applicable device drivers to the reference image, connect or turn on the applicable devices so that Windows can install them, and use the Microsoft-Windows-PnpSysprep/DoNotCleanUpNonPresentDevices setting when you capture the image.

Important

Using the DoNotCleanUpNonPresentDevices setting can lead to the unnecessary storage of excess device states and contribute to slower boot times.

In the following example, a fictitious IHV named Fabrikam produces two types of storage controllers: StandardController and ExtremeController. Fabrikam assumes that only one type of storage controller is installed at a time on a particular computer.

The driver package defines the StandardController and ExtremeController configurations to use the same driver service name, storctrl. The storctrl driver service uses different service settings that change depending on which hardware (StandardController or ExtremeController) is installed. Because both StandardController and ExtremeController use the same service, they cannot coexist.

This sample shows the contents of the driver package file Storctrl.inf:

If StandardController is on the reference computer and its settings are maintained during image capture, the storctrl driver service is preconfigured. If ExtremeController is on the destination computer, Windows may use the preconfigured settings and files that are intended for StandardController. This can cause unexpected results.

The IHV can help resolve the conflict by using one of these options:

Create separate driver packages that have separate .inf files for each configuration, and import only the required driver package into the Windows image during deployment. For example, split Storctrl.inf into two separate .inf files, one version for StandardController and one version for ExtremeController, and import only the required driver package into the Windows image.

Create another service in the driver package for each configuration. Give each service a different name (for example, storctrl and storctrlx) and point to a different binary image file (for example, Storctrl.sys and Storctrlx.sys).