Walkthrough: Deploy an Image by Using PXE

Applies To: Windows 7, Windows Server 2008 R2

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

This walkthrough describes how to set up a third-party Preboot Execution Environment (PXE) server by using Windows® PE 2.0. The process includes copying Windows PE 2.0 source files to your PXE server and then configuring your PXE server boot configuration to use Windows PE.

Prerequisites

To complete this walkthrough, you need a technician computer, which provides all the tools and the source files. For more information, see Building a Technician Computer.

Step 1: Copy Source Files onto PXE Server

In this step, you copy Windows PE source files to your PXE server.

  1. On your technician computer, click Start, point to Programs, point to Windows OPK or Windows AIK, and then click Windows PE Tools Command Prompt.

    The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\<version>\Tools, where <version> can be Windows OPK or Windows AIK.

  2. Run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location.

    copype.cmd <arch> <destination>
    

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

    copype.cmd x86 c:\winpe_x86
    

    The script creates the following directory structure and copies all the necessary files for that architecture. For example,

    C:\winpe_x86
    C:\winpe_x86\ISO
    C:\winpe_x86\mount
    
  3. Mount the base Windows PE image to the \Mount directory by using the ImageX tool. For example,

    imagex /mountrw C:\winpe_x86\winpe.wim 1 C:\winpe_x86\mount
    
  4. Map a network connection to the root TFTP directory on the PXE/TFTP server and create a \Boot folder. For example,

    net use N: \\<PXEServer>\TFTPRoot
    md N:\Boot
    
  5. Copy the Boot.sdi file to the PXE/TFTP server.

    copy c:\Program Files\<version>\Tools\PETools\x86\boot\boot.sdi N:\Boot
    

    where <version> can be Windows OPK or Windows AIK.

  6. Unmount the current Windows PE image and copy the bootable Windows PE image to the \Boot folder.

    Imagex /unmount C:\winpe_x86\mount
    copy c:\winpe_x86\winpe.wim N:\Boot\boot.wim
    

    The base Windows PE image (Winpe.wim) must be renamed to Boot.wim.

Step 2: Configure boot configuration

In this step, you create a BCD Store by using the BCDEdit tool. The BCDEdit tool can be run only from a Windows® 7 computer or a Windows PE environment. The BCDEdit tool is located in the \Windows\System32 directory.

  1. On a Windows® 7 computer or in a Windows PE environment, create a BCD store by using the BCDEdit tool. For example,

    Bcdedit -createstore c:\BCD
    
  2. Create the RAMDISK settings. For example,

    Bcdedit -store c:\BCD -create {ramdiskoptions} /d "Ramdisk options" 
    Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdidevice  boot
    Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi
    
  3. (Optional) Create kernel debugger settings. For example,

    Bcdedit -store c:\BCD -create {dbgsettings} /d "Debugger settings" 
    Bcdedit -store c:\BCD -set {dbgsettings} debugtype serial
    Bcdedit -store c:\BCD -set {dbgsettings} baudrate 115200
    Bcdedit -store c:\BCD -set {dbgsettings} debugport 1
    
  4. Create OSLoader settings for the Windows PE image. For example,

    Bcdedit -store c:\BCD -create /d "MyWinPE Boot Image" /application osloader
    
    Bcdedit -store c:\BCD -set {guid1} systemroot \Windows
    Bcdedit -store c:\BCD -set {guid1} detecthal Yes
    Bcdedit -store c:\BCD -set {guid1} winpe Yes
    Bcdedit -store c:\BCD -set {guid1} osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
    Bcdedit -store c:\BCD -set {guid1} device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
    
  5. Create the BOOTMGR settings. For example,

    Bcdedit -store c:\BCD -create {bootmgr} /d "Windows BootManager"  /inherit {dbgsettings} 
    Bcdedit -store c:\BCD -set {bootmgr} timeout 30 
    Bcdedit -store c:\BCD -displayorder {guid1} {guid2}
    

    where guid1, guid2, and so on are the GUIDS for each .wim file entry.

  6. Copy the BCD file to your server. For example,

    copy c:\BCD N:\Boot
    
  7. Configure your PXE/TFTP server to point PXE clients to download WDSNBP.COM.

Your PXE/TFTP server is now configured.

Deployment process

The following outlines the download process.

  1. A client is directed (by using DHCP Options or the PXE Server response) to download Wdsnbp.com

  2. Wdsnbp.com validates the DHCP/PXE response packet and proceeds to download PXEBoot.com.

  3. PXEBoot.com downloads Bootmgr.exe and the BCD store. The BCD store must reside in a \Boot directory in the TFTP root folder. Additionally, the BCD store must be called BCD.

  4. Bootmgr.exe reads the BCD operating system entries and downloads Boot.sdi and the Windows PE image .

  5. Bootmgr.exe begins booting Windows PE by running Winload.exe within the Windows PE image.

See Also

Concepts

Windows PE Walkthroughs