Creating, Validating, and Testing Boot Images

Applies To: Windows Server 2008 R2

Create a Windows PE image to use with ImageX for copying your image

If you have the Windows Automated Installation Kit (Windows AIK) installed, you can view the instructions for creating a Windows PE image in “Step-by-Step: Basic Windows Deployment for IT Professionals,” located in the documentation directory of the Windows AIK installation.


You must run a 64-bit version of Windows on the computer that is used to create the Windows PE image for the image to be deployable on a computer running Windows Server 2008 R2. Because Windows Server 2008 R2 is available only in 64-bit versions, this documentation discusses the creation and use of only 64-bit Windows PE versions.


The Windows AIK is required for the following procedure. If you have installed the Windows AIK by using the default directory location, you can copy and paste the following commands into a command prompt.

To create bootable Windows PE media for use with ImageX

  1. On your technician computer, run the copype.cmd script to create a local Windows PE build directory. For example, at a command prompt, type:

    cd C:\Program Files\Windows AIK\Tools\PETools\copype.cmd*<architecture><destination>*

    where <architecture> can be x86, amd64, or ia64, and <destination> is the path to the local directory. For example:

    copype.cmd amd64 C:\winpe_amd64

  2. Copy winpe.wim to the appropriate folder, and then rename it to boot.wim. For example: copy C:\winpe_amd64 C:\winpe_amd64\ISO\sources\boot.wim and rename it to copy C:\winpe_amd64 C:\winpe_amd64\ISO\sources\boot.wim.

  3. Optionally, create a configuration file called Wimscript.ini by using a text editor such as Notepad. The configuration file instructs the ImageX tool to exclude certain files during the capture operation. For example:


    • ntfs.log

    • hiberfil.sys

    • pagefile.sys

    • "System Volume Information"


    • Windows\CSC


    • *.mp3

    • *.zip

    • *.cab

    • \WINDOWS\inf\*.pnf

  4. Save the configuration file to the same location as the ImageX tool as specified in the previous step. For example:



The ImageX tool automatically detects Wimscript.ini only if the .ini file is saved to the same location as the ImageX tool. We also recommend that you include the bcdboot tool in the ISO layout, which will be needed when deploying images to make the image bootable after deployment.

  1. Copy C:\Program Files\Windows AIK\Tools\AMD64\bcdboot.exe C:\winpe_amd64\ISO\.

  2. Copy the following files to the C:\winpe_amd64\Boot directory:

    • Copy C:\Program Files\Windows AIK\Tools\AMD64\oscdimg.exe C:\winpe_amd64\Boot

    • Copy C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\ C:\winpe_amd64\Boot

  3. Create an image (.iso) file by using the oscdimg tool. For example, at a command prompt, type:

    cd C:\winpe_amd64\Boot

    oscdimg.exe -n C:\winpe_amd64\ISO C:\winpe_amd64\winpe_amd64.iso

  4. Burn the image (winpe_x86.iso) to a CD-ROM disc. The Windows AIK does not include CD-ROM burning software. Use trusted third-party software to burn the image to a CD-ROM disc.

You now have a bootable Windows PE RAM CD containing the ImageX tool. For more information about Windows PE, see the Windows Preinstallation Environment (Windows PE) User’s Guide (Winpe.chm).

Capture the installation onto a network share

Capture an image of your source computer by using Windows PE and the ImageX tool. Then, store that image on a network share. Alternatively, you can save this image to another drive, such as a connected USB flash drive, or you can mount the iSCSI disk on another computer, and then capture the image for deployment.

To capture the installation onto a network share

  1. On your source computer, insert your Windows PE media and restart the computer.


To boot from the CD/DVD-ROM drive, you may have to override the boot order. During initial boot, select the appropriate function key to override the boot order.

Windows PE starts and then launches a command prompt window. You may wish to run **diskpart** and use “List vol” to list all the available volumes to ensure that you are using the correct drive letters for your image. The letters in use will likely be different from the ones that were in use when you last restarted the computer.
  1. Capture an image of the reference installation by using the ImageX tool located on your Windows PE media. For example, at the command prompt, type:

    e:\imagex.exe /capture d: d:\myimage.wim "my Win7 Install" /compress fast /verify

  2. Copy the image to a network location. You can do this because Windows PE provides network support. For example, at the command prompt, type:

    net use y: \\network_share\images copy d:\myimage.wim y:

  3. If necessary, provide network credentials for appropriate network access.

Integrate iSCSI Software Initiator support into a Windows PE image


This section is intended for installation purposes only, and does not include support for MPIO with iSCSI connections.


This procedure is only required if you want to access the iSCSI Initiator graphical user interface (GUI) from Windows PE to access an iSCSI target device that is not the boot device, such as an additional iSCSI disk to copy a deployment image to or from. The command line version of iSCSI (msiscsicli.exe) is accessible from Windows PE.

The following are prerequisites for doing this installation:

  • A computer that is running Windows Server 2008 R2 and using the Windows AIK

  • A DVD burner and software

To integrate iSCSI Software Initiator support into a Windows PE image

  1. After installing the Windows AIK, open the deployment command prompt (Administrator: Windows PE Tools Command Prompt), and then do the following:

    1. Run copype.cmd <arch> <path>. For example, copype.cmd AMD64 C:\bin. When complete, the command prompt changes to C:\bin.

    2. Mount the boot.wim by using the following: imagex /mountrw C:\bin\ISO\sources\boot.wim 1 C:\bin\mount

  2. Add drivers as appropriate by using the Dism command with the /Add-Driver option. For example:

    Dism /image:C:\winpe_x86\mount /Add-Driver /driver:C:\test\drivers\mydriver.inf

  3. Copy the following files from a computer that is running Windows Server 2008 R2 to the corresponding folder of the mounted Windows Imaging Format (WIM):


Some of the files may already be in the Windows PE image.

    8 File(s)        918,120 bytes
    1 File(s)        168,552 bytes
    4 File(s)         84,992 bytes
  1. Mount the registry hives for editing by doing the following:

    1. Click Start, click Run, type regedit.exe, and then press ENTER.

    2. On the User Account Control page, click Continue.

    3. Click HKEY_LOCAL_MACHINE, and on the File menu, click Load Hive.

    4. Change the directory to C:\bin\mount\windows\system32\config.

    5. Click Software, and then click OK.

    6. When you are prompted for a name, type PE_Soft.

    7. Repeat the preceding steps to mount the System hive. When you are prompted for a name, type PE_Sys.


The naming convention is important to ensure that you do not have to rename the corresponding portions of the registry files. The names must match or the relevant sections will not be added.

8.  Merge PE\_Soft.reg and PE\_Sys.Reg into the registry hives that were loaded in the previous steps. See the sections that follow this procedure to copy the contents that are required for these two files.
  1. Unload the hives by doing the following:

    1. In regedit, click PE_Soft, and on the File menu, click Unload Hive.

    2. Click PE_Sys, and on the File menu, click Unload Hive.

  2. Unmount and commit the changes to the WIM. For example:

    imagex /commit /unmount C:\bin\mount

Software registry hive (PE_Soft)

This section includes the contents that you must add to a text file named PE_Soft.reg to merge the registry hive.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\Svchost]


[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI]

[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery]

[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Authentication Cache]

[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Send Targets]

[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Static Targets]

[HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Tunnel Address]

System registry hive (PE_Sys)

This section includes the contents that you must add to a text file named PE_Sys.reg to merge the registry hive.

Windows Registry Editor Version 5.00



"DeviceDesc"="@iscsi.inf,%iscsiprt%;Microsoft iSCSI Initiator"

[HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\Device Parameters]

[HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\Device Parameters\StorPort]



"DisplayName"="iScsiPort Driver"



"RebootMessage"="See Note 3 below"







Windows Registry Editor Version 5.00


"DriverDesc"="Microsoft iSCSI Initiator"




Create an ISO image to burn to a CD or DVD

For additional details, see “Walkthrough: Create a Custom Windows PE Image” in the WinPE.CHM file, included with the Windows AIK.

To create a bootable CD-ROM

  1. On your technician computer, at a command prompt, create an .iso file by using oscdimg. For example,

    oscdimg -n –b C:\winpe_AMD64\ C:\winpe_ AMD64\ISO c:\winpe_ AMD64\winpe_ AMD64.iso

  2. Burn the image (winpe_ AMD64.iso) to a DVD-ROM by using a utility capable of burning an .iso image to DVD.

Test and validate the completed Windows PE image

After you have copied the customized Windows PE bits to your choice of media (DVD/CD/USB flash drive) and booted to Windows PE, complete the following procedure.

To test and validate the Windows PE image if you have integrated support for the iSCSI GUI

  1. At a command prompt, type Net start MSiSCSI, and then press ENTER.

  2. Change directories to x:\windows\system32, type iscsicpl.exe, and then press ENTER. This launches the graphical user interface (GUI) for the Microsoft iSCSI Initiator.

  3. On the iSCSI device, provision the storage and set up the device to authenticate with PE iSCSI qualified name (IQN).

  4. On the computer that is running Windows PE, do the following:

    1. On the iSCSI GUI, click the Target tab, and then, in the Quick Connect field, type the portal (IP address for the target computer).

    2. Log on to the computer.

    3. Open a command prompt, type diskpart, and then press ENTER.

    4. Type list disk, and then press ENTER.

    5. Select the new disk by typing Select Disk <X> where X is the disk number of the disk that is connected, and then press ENTER.

    6. Create the partition, format it, and then assign a drive letter to it. For example, to create a partition, format it as NTFS, and assign the next available drive letter, you would use the following commands:

      Create Partition Primary

      Format FS=NTFS quick



    7. Test the target.