Skip to main content

Creating a boot (WinPE) file

You can create boot files that can be used to customize Windows images.

Before you begin

  • Ensure that the operating system you intend to provision is installed on the host. For example, if you plan to provision Windows 2016 using the WinPE files, then install Windows 2016 on the host.

  • Ensure that the Microsoft ADK that is compatible with the installed operating system is also installed on the host. For example, Windows 2012R2 requires ADK version 8.1 Update.

  • Obtain the device drivers, in .inf format, that you want to add to the boot file.

    You can obtain device drivers from the Lenovo YUM Repository webpage, from the vendor (such as Red Hat), or through a custom device driver that you generated yourself. For some Windows device drivers, you can generate a custom device driver by extracting the device driver from the installation .exe to your local system and creating a .zip archive file.

    Lenovo also bundles sets of predefined device drivers into a single package that can be downloaded from the Lenovo Windows drivers and WinPE Images Repository webpage and then imported into OS-images repository. Currently, the bundle files are available only for Windows. If the bundle file contains both device drivers and boot files, you can import the bundle file from the Device Driver or Boot Image tab.

  • Download the genimage.cmd and startnet.cmd files to the host in a temporary directory, such as C:\customwim.

    The genimage.cmd command is used to generate the WinPE boot files, including the .wim file. The startnet.cmd command is used by XClarity Administrator to bootstrap the Windows installer.

  • Decide how you want to inject device drivers into the boot file. You can do this in one of the following ways:

    • Add in-box device drivers to a customized Windows profile by copying the device-driver files to the host system in the C:\drivers directory. These will be included in the boot file when genimage.cmd runs later.

      Note
      When you create a custom OS-images profile that uses the custom boot-file, the device drivers that are in the C:\drivers directory are included in both WinPE and the final OS. They are treated as though they were inbox. Therefore, you do not need to import these in-box device drivers into XClarity Administrator when you specify device drivers to use in the custom OS-images profile creation.
    • Add out-of-box device drivers directly to the boot file.

      Note
      If you use this method, the device drivers are only applied to the boot file and therefore to the WinPE install environment. The device drivers are not applied to the final installed OS. You must manually import the device drivers into the OS-images device driver repository and select them for use as part of the OS-image profile customization.
  • For more information about boot files, see the Introduction to Window PE (WinPE) website.

Procedure

To create a boot file, complete the following steps.

  1. Using a user ID with administrator authority, run the Windows ADK command Deployment and Imaging Tools Environment. A command session is displayed.
  2. From the command session, change to the directory where the genimage.cmd and starnet.cmd files were downloaded (for example, C:\customwim).
  3. Ensure that no previously mounted images are on the host by running the following command:
    dism /get-mountedwiminfo

    If there are mounted images, discard them by running the following command:

    dism /unmount-wim /MountDir:C:\<mount_path> /Discard
  4. If you are adding in-box device drivers to a customized Windows profile, copy the raw device-driver files, in .inf format, to the host system in the C:\drivers directory.
  5. Run the following command to generate the boot file, in .wim format, and then wait a few minutes for the command to complete.
    genimage.cmd amd64 <ADK_Version>
    Where <ADK_Version> is one of the following values.
    • 8.1. For Windows 2012 R2

    • 10. For Windows 2016

    This command creates the boot file: C:\WinPE_64\media\Boot\WinPE_64.wim.

  6. Mount the boot file by running the following command:
    DISM /Mount-Image /ImageFile:C:\WinPE_64\media\Boot\WinPE_64.wim /index:1 /MountDir:C:\WinPE_64\mount
  7. If you are adding out-of-box device drivers directly to the boot file, complete the following steps.
    1. Create the following directory structure, where <os_release> is 2012, 2012R2, or 2016

      drivers\<os_release>\
    2. Copy the device drivers, in .inf format, to a directory inside that path, for example:

      drivers\<os_release>\<driver1>\<driver1_files>
    3. Copy the drivers directory to the mount directory, for example:

      C:\WinPE_64\mount\drivers
  8. Optional: Make additional customizations to the boot file, such as adding folders, files, startup scripts, language packs, and apps. For more information about customizing boot files, see the WinPE: Mount and Customize website.
  9. Unmount the image by running the following command.
    DISM /Unmount-Image /MountDir:C:\WinPE_64\mount /commit
  10. Compress the contents of the C:\WinPE_64\media directory into a zip file called WinPE_64.zip.
  11. Import the .zip file into XClarity Administrator (see Importing boot files).