Apply a Windows Image to UEFI-based Computers

The Unified Extensible Firmware Interface (UEFI) is a specification that defines an interface between operating systems and platform firmware. UEFI is designed to replace traditional BIOS firmware.

If you are using imagex /apply to install Windows, deploying to UEFI-based computers may require additional preparation and configuration. UEFI-based computers include a separate partition to store files require for booting operating systems. This UEFI System Partition (ESP) partition must also be captured along with the customized Windows image. In addition, some GPT disks include a Microsoft Reserved Partition (MSR). Microsoft recommends that all GPT disks include an MSR. This partition must exist between the ESP and the Windows operating system partitions. For more information about GPT disks, EFI, and hard disk partitions, see The Windows and GPT FAQ.

The partition layout on the reference and destination computers must be identical. For example, if you capture a custom Windows image on drive D, you must always deploy that image onto drive D on the destination computer. The following list describes the partition settings that must be identical across the reference and destination computers when you use the imagex /apply command.

  • The partition number where Windows is installed must match.
  • The partition type (primary, extended, or logical) must match.
  • If the partition is set to Active on the reference computer, the destination computer must also be set to Active.
  • If you have another active partition for Bootmgr and BCD stores on the reference system, you must also capture this partition and apply it to the same partition on the destination computer.

If you perform an attended Windows Setup installation, The ESP and BCD entries are automatically created and configured during installation. If you perform an unattended Windows installation, you must create partitions for the ESP, MSR, and the Windows partition in your answer file.

The following procedures use the imagex /apply command to deploy a Windows image.

Installing Windows to a Master Computer

During this phase, you install Windows to a UEFI-based computer and customize the installation to meet your requirements. This Windows image becomes your master image that you use to deploy to other computers. To install Windows to an EFI-based computer, you must enable EFI mode in the computer's firmware and boot with 64-bit pre-installation media.

For more information, see Installing Windows to an EFI-Based Computer.

After completing this step, you will have two separate Windows images, one for the ESP, and another for the Windows operating system image.

Apply a Windows Image to an EFI-based Computer

This procedure assumes that you have installed Windows to an EFI-based master computer and captured the Windows operating system and the ESP images. For instructions, see Installing Windows to an EFI-Based Computer.

  1. Boot the target computer by using Windows PE.

Important

You must boot Windows PE by using the EFI boot mode option in the EFI shell. For more information, see your EFI firmware documentation.

  1. Configure the target system disk partitions to exactly match the partitions on the master computer by creating the identical ESP, MSR, and operating system partitions.
    The following Diskpart command creates the EFI, MSR, and primary system partitions:

    Diskpart
       Select disk  0                  // 0 being the disk to setup
       Clean                           // wipe the disk
       Convert gpt                     // convert disk to GPT
       Create partition efi size=200   // EFI system partition
       Assign letter=s                 // Any allowable letter
       Format quick fs=FAT32           // Format the ESP
       Create partition msr size=128   // Create the MSR partition
       Create partition primary        // Create Windows partition
       Assign letter=c
       Format quick fs=NTFS            // Format primary partition
       Exit
    

Note

The partition sizes and types of the destination computer must exactly match the partition structure of the master computer.

  1. Create a network share where you intend to copy your master Windows image and ESP image to. For example,

    net use n: \\MyNetworkShare\Images
    
  2. Apply the EFI system partition image. This step copies all of the EFI boot applications, EFI drivers and other ESP boot files to the target partition. For example,

    imagex /apply n:\image\efisys.wim 1 s:\
    
  3. Apply the operating system partition to the correct partition. For example,

    imagex /apply n:\image\osimage.wim 1 c:\
    
  4. Update the BCD Boot Manager and Memory Test settings to point to the correct device partition. The s: partition is the temporary drive letter of the ESP:

    bcdedit /set {bootmgr} device partition=s:
    bcdedit /set {memdiag} device partition=s:
    

    During this step, Bcdedit.exe creates an EFI non-volatile random access memory (NVRAM) entry for the Windows Boot Manager.

  5. Update the BCD default Windows Loader objects to point to the correct device partition. C:\ is the drive letter of the primary operating system partition.

    bcdedit /set {default} device partition=c:
    bcdedit /set {default} osdevice partition=c:
    
  6. Update the BCD firmware entry settings to reference the Windows Boot Manager as the first boot option:

    Bcdedit /set {FWbootmgr} displayorder {Bootmgr} /addfirst
    
  7. Reboot the system and verify that Windows is installed and configured correctly.

These are the minimum Bcdedit changes that are necessary to make the disk image on the target system bootable. For more information on BCD settings for the Boot Manager and Boot Loader, see Modify the BCD Store Template and Remove Duplicate Firmware Objects in BCD and NVRAM.

See Also

Concepts

Create an Answer File for UEFI-based Computers