Deploy Windows 11 in virtual machine using bootable Windows PE (WinPE) Image
search cancel

Deploy Windows 11 in virtual machine using bootable Windows PE (WinPE) Image

book

Article ID: 312106

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Windows 11 hardware requirements include “Trusted Platform Module (TPM) version 2.0" . For more information, see Windows 11 requirements .Windows 11 installer has a restriction to only install on the systems that include a TPM or vTPM device.
 

For Windows 11 deployment, it is not best practice to install Windows 11 in the virtual machine with a vTPM device and later remove the vTPM device to create a VM template, because the secrets stored in the vTPM will be deleted and this can result in data loss. If using this method ensure that neither Windows nor any third party applications are using the TPM. The best practice for creating a template without a vTPM is to install Windows 11 from the start in the virtual machine without a vTPM device to eliminate the risk of data loss.

This article describes how to deploy Windows 11 in virtual machine without a vTPM device using a bootable WinPE image, which is valuable for creating a Golden Image Template or an OVA Template. Users can deploy Windows 11 at scale from the template, then add a new unique virtual TPM device into each deployed VM instance. Using a bootable WinPE image provides a simple process to deploy Windows 11 into a VM without a vTPM from the start that is fully supported by Microsoft and VMware.

NOTE: All resulting deployed VMs for end users with Windows 11 should include a vTPM to comply with Microsoft's minimum hardware requirements and to ensure a higher level security.


Environment

VMware vSphere ESXi 6.7
VMware vSphere ESXi 7.0.x

Resolution

To create a bootable WinPE ISO image:

  1. Download and install Windows 11 Assessment and Deployment Kit (ADK) and Windows 11 Assessment and Deployment Kit WinPE Add-on in a Windows virtual machine. Download LINK
  2. Create 4 directories in this virtual machine:
    C:\test\winpe\    - used as working directory of WinPE.
    C:\test\mount\    - used as the mount directory of WinPE image.
    C:\test\drivers\  - (optional) contains the drivers files.
    C:\test\scripts\  - contains the scripts.
  3. Click "Start" -> "All apps" -> "Windows Kits", right-click "Deployment and Imaging Tools Environment" and select "Run as an administrator", execute below command to create a working directory containing base WinPE files:
    copype amd64 C:\test\winpe
  4. Execute this command to mount WinPE image in directory C:\test\mount\:

dism /Mount-Image /ImageFile:C:\test\winpe\media\sources\boot.wim /index:1 /MountDir:C:\test\mount\

  1. Prepare scripts and put them in this folder C:\test\scripts\, then copy scripts to below WinPE image mount path:
    copy startnet.cmd C:\test\mount\Windows\System32\
    copy deploy.cmd C:\test\mount\
    copy CreatePartitions-UEFI.txt C:\test\mount\
    copy Unattend.xml C:\test\mount\
    1. Create a WinPE startup script, named “startnet.cmd” : (Sample file attached to this article)
Note: To create the script:
-Open a new text editor (notepad).
-Copy and paste the script content into the notepad.
-Save as startnet.cmd
  1. Create a script to create disk partitions, apply Windows image, named “deploy.cmd”. Sample file (attached to this KB article)
  2. Create a DiskPart script to format and set up the hard disk partitions for Windows, see this LINK
For Example:  copy and change the file of creating the System, MSR, Windows, and recovery tools partitions for UEFI-based PCs in above link, named “CreatePartitions-UEFI.txt”.
  1. (Optional) Create an unattend xml file for Windows OOBE configuration pass when booting to Windows at first time. Sample file (attached to this KB article)
  1. (Optional) Get VMware PVSCSI driver files. There are 2 methods to get PVSCSI driver files, then copy the driver files from C:\test\drivers\ to C:\test\mount\drivers\
  • From VMware tools ISO package:
Download VMware tools ISO file from this LINK . Mount VMware tools ISO in this virtual machine, if mounted drive is “E:”, then copy PVSCSI driver files from this path E:\Program Files\VMware\VMware Tools\Drivers\pvscsi\Win10\amd64\ to C:\test\drivers\
  • From Microsoft Update Catalog:
Download VMware tools driver from Microsoft Update Catalog . Expand downloaded “.cab” file by executing this command:
expand C:\xxxx.cab -F:* C:\test\drivers\
  1. (Optional) Add VMware PVSCSI driver or other drivers to WinPE image by executing this command:
    dism /image:C:\test\mount\ /add-driver /driver:C:\test\drivers\ /Recurse
  2. (Optional) You can also do other customizations on WinPE image.
  3. Commit the changes and unmount the image, then create the WinPE ISO file:
    dism /Unmount-Image /MountDir:C:\test\mount /Commit
    MakeWinPEMedia /ISO C:\test\winpe C:\test\WinPE_amd64.iso

To deploy and install a new Windows 11 virtual machine:

  1. Create a new virtual machine by selecting “Microsoft Windows 10 (64bit)” as guest OS type and without vTPM device, change VM settings to meet Windows 11 CPU, memory, storage, firmware requirements when necessary, add 2 CD/DVD drives and preferred virtual devices.
  2. Connect generated WinPE ISO “WinPE_amd64.iso” above to the 1st CD/DVD, connect Windows 11 installation ISO image to the 2nd CD/DVD.
  3. Launch virtual machine remote console, power on the virtual machine, press any key when prompting “Press any key to boot from CD or DVD…”, it will boot to WinPE and execute startup script.
  4. In sample script “deploy.cmd”, it will prompt you to select the index of OS Edition in Windows installation ISO image, input the OS Edition index and press Enter. OS image will be applied to Windows partition.
  5. After reboot, OS starts country or region, keyboard layout, sign in configurations if you do not use unattend xml answer file.

 

 
 

 

Attachments

sample_files get_app