How to install Windows 11 on VMware Workstation

For testing purposes, I frequently use VMware Workstation to install Operating Systems such as Windows 11.  The biggest challenge with Windows 11 is that you need a TPM 2.0 device. When installing Windows 11, if your computer does not meet the hardware requirements, you will see a message stating, “This PC can’t run Windows 11“.

Windows 11 requires the following hardware specifications:

  • CPU: 1 GHz or faster with 2 or more cores on the processor
  • RAM: 4 GB RAM
  •  Storage: 64 GB or larger
  • Firmware: UEFI, Secure boot
  • TPM: Trusted Platform Module (TPM) 2.0

More info: link

The following options are available when installing Windows 11 using VMware Workstation Pro/Player and Fusion:

Option 1: The physical endpoint such as a laptop or PC has a TPM 2.0 device. This requires adding encryption and adding a vTPM device.

Option 2: The physical endpoint such as a laptop or PC has compatible hardware but no TPM 2.0 device. VMware Workstation 16.2 Pro adds an experimental vTPM device that uses a new encryption mode with increased performance over fully encrypting the VM in option 1.

Update October 17, 2022:  Wil van Antwerpen has a good blog post about the risks of this experimental feature.  Make sure that you read the blog before using this feature!

What you should know about VMware’s experimental vTPM – Vimalin

Option 3: The physical endpoint such as a laptop or PC has no compatible hardware such as a TPM 2.0 device. Use a registry hack to bypass the TPM check.

If you don’t have a Windows 10/11 ISO, you can create one following this blog post: Quick Tip: Download the latest Windows 10/11 ISO files – ivobeerens.nl

Here are the steps outlined for each option:

Option 1. The physical endpoint such as a laptop or PC has a TPM 2.0 chip

Start VMware Workstation and create a new Virtual Machine with the following configuration:

  • Type of configuration: Custom (advanced)
  • Virtual Machine hardware compatibility: Workstation 16.2.x
  • Guest Operating System Installation: Installer disc image file (iso): Point to the downloaded Windows 11 ISO
  • Guest operating system: Microsoft Windows
    • Version: Windows 10 and later x64
  • Virtual Machine name: Name of the VM such as: Windows 11
    • Location: for example: c:\vms\win11
  • Firmware: UEFI
    • Secure boot: Check
  • Processors: 2 or more
    • Number of cores: 1 or more
  • Memory (MB): 4096 or more
  • Network Type: Use network address translation (NAT)
  • SCSI Controller: LSI Logic SAS or Paravirtualized SCSI
  • Virtual Disk Type: NVMe
  • Disk: Create a new virtual disk
    • Maximum disk size (GB): 64 or more
  • Disk file: Windows 10 and later x64.vmdk
  • The new VM will be created.
  • Edit the virtual machine settings
  • Click on the options tab, choose Access Control, and select Encrypt

  • Enter a virtual machine password twice

  • The VM will be encrypted
  • Select the Hardware tab and select Add
  • Select the Trusted Platform Module and click Finish and OK

  • Start the VM to install Windows 11

The VM is encrypted and has a TPM device configured.

 

Option 2: The physical endpoint such as a laptop or PC has compatible hardware but no TPM 2.0 device.

Since VMware Workstation 16.2 there is an experimental feature without the need fully encrypt the VM. Use it with care and read the blog from Wil van Antwerpen before using this feature!

  • Follow the steps in step 1 till  ” The new VM will be created”
  • Before starting the VM close VMware Workstation
  • Edit the VMX file of the created VM in notepad for example
    • Add the following line to the end of the file:
    • managedVM.autoAddVTPM = “software”
    • This line adds a TPM 2.0 device to the VM
    • Save the VMX file

  • Open VMware Workstation
  • Start the VM to install Windows 11

Option 3: The physical endpoint such as a laptop or PC has no compatible hardware such as a TPM 2.0 device. Use a registry hack to bypass the TPM check.

In 2021 I already blogged about this hack. More information can be found here: Install Windows 11 as VM on VMware vSphere / Workstation without TPM 2.0 – ivobeerens.nl

 

With these 3 options, you are able to install Windows 11 on VMware Workstation Pro/Player and Fusion in most situations.

Disable the little drawing (known as search highlights) in the Windows 10/11 search bar

After deploying new Windows 10/11 images with the latest updates, Microsoft has included Search highlights. You can see if you have search highlights enabled when having a little drawing in the search bar. When clicking on the search bar it extends with graphics and more crap.

So what are search highlights?

Designed to help Windows users discover more information and related content, search highlights present noteworthy, informative, and interesting information of what’s special about each day—like holidays, anniversaries, and other moments in time both globally and in your region

This new feature can be nice for home users but not for most enterprise environments. So I disable this feature for all the Windows 10/11 deployments.

Disable search highlights by using a Group Policy Object (GPO) 

  • Make sure you have at least the Administrative Templates (admx) for Windows 10 November 2021 Update (21H2) – v2.0 (link).
  • Copy the ADMX files to the Group Policy Central Store in the sysvol folder (example: \\<fqd domain name>\SYSVOL\<fqd domain name>\policies\PolicyDefinitions)
  • Create or edit a Group Policy Object (GPO) to the OU where the computer objects are placed
  • Browse to Computer Configuration – Policies – Administrative Templates – Windows Components – Search
  • Open the “Allow search highlights” setting and select Disable
  • Perform a “gpupdate /force”  on the Windows client

 

Disable search highlights by registry setting

Another method is by creating a registry key on the Windows 10/11 machine.

  • Execute the following command as administrator:
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "EnableDynamicContentInWSB" /t REG_DWORD /d "0" /f

Disabling this setting turns off search highlights in the taskbar search box and in search home.

Use Packer to install Windows 11 and enable vTPM and VBS

I use Packer for building images for VMware VDI environments. With the latest version (when writing this blog Packer version 1.7.7 is the latest version) it is not possible to configure a TPM in the Hashicorp Configuration Languag (HCL) config file. TPM 2.0 is required to install Windows 11. A vTPM emulates a physical TPM 2.0 and is available in VMware vSphere.

Update: January 27, 2022: Packer with the VMware vSphere plugin ((V1.0.3) has now support for adding a vTPM device. More information can be found here: link.

You can install Windows 11 using a registry hack (link) to bypass the TPM check:

reg ADD "HKLM\SYSTEM\Setup\LabConfig" /f /v BypassSecureBootCheck /t REG_DWORD /d 1

vCommunity member Sidney Laan from vEUCaddict wrote a nice blog about using Packer to install Windows 11 using this registry hack (link). When using this hack, it doesn’t enable vTPM or VBS.

For LAB environments, this is no issue but for production, environments you want to have a vTPM enabled and even Virtualization-Based Security (VBS) depending on the security requirements.

So what are TPM and VBS?

TPM

Trusted Platform Module (TPM) technology is designed to provide hardware-based, security-related functions. A TPM chip is a secure crypto-processor that helps you with actions such as generating, storing, and limiting the use of cryptographic keys.

VBS

Virtualization-based security, or VBS, uses hardware virtualization features to create and isolate a secure region of memory from the normal operating system. Windows can use this “virtual secure mode” to host a number of security solutions, providing them with greatly increased protection from vulnerabilities in the operating system, and preventing the use of malicious exploits which attempt to defeat protections.

source link

After the Windows 11 installation with Packer, it is possible to add a vTPM and even enable Virtualization-Based Security (VBS)  by using VMware PowerCLI.

Requirements

  • Use vCenter Server system versions 6.7 or later
  • Add a Key Provider (link)
  • Install PowerCLI by using the following command in PowerShell:
    • Install-Module VMware.PowerCLI -Scope CurrentUser
  • The Windows 11 VM must be powered off
  • Use VM hardware version 14 or higher
  • Don’t create a snapshot with Packer (create_snapshot = false)

PowerCLI Script

The following PowerCLI script can be executed after the Packer Windows 11 deployment. This script adds vTPM, enables VBS support, and creates a snapshot.

  • Change the variables for your environment.

# Import PowerCLI 
Import-Module VMware.PowerCLI

# Variables
$vcentername = "vcentername"
$VMTempName = "VMname"
$snapname = "v0.1"
$snapdescription = "Packer deployement with vTPM and VBS enabled"

# Connect to vCenter Server
Connect-VIServer -Server $vcentername

# Add vTPM
Write-Host 'Set vTPM' 
New-VTpm -VM $VMTempName

# Enable Virtualization Based Security (VBS)
Write-Host 'Enable VBS' 
$vm = Get-VM $VMTempName
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.Firmware = [VMware.Vim.GuestOsDescriptorFirmwareType]::efi
$spec.NestedHVEnabled = $true
$boot = New-Object VMware.Vim.VirtualMachineBootOptions
$boot.EfiSecureBootEnabled = $true
$spec.BootOptions = $boot
$flags = New-Object VMware.Vim.VirtualMachineFlagInfo
$flags.VbsEnabled = $true
$flags.VvtdEnabled = $true
$spec.flags = $flags
$vm.ExtensionData.ReconfigVM($spec)

# Create Snapshot
Write-Host 'Create snapshot' -ForegroundColor green
Get-VM -Name $VMTempName | New-Snapshot -Name $snapname -Description $snapdescription
    
# Disconnect vCenter Server
Disconnect-VIServer -Server * -Confirm:$false
  • When the script is finished, vTPM and VBS support is added
  • Start the VM
  • Check if a TPM is displayed in Device Manager and with the TPM.MSC command

  • Using Powershell the command “Get-TPM” can check the presence of the TPM

    • For Enabling VBS (*1) go to “Device security” in Windows 11, select “Core isolation details” and enable “Memory Integrity”
        • Enabling VBS can also be done by using the following registry settings
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "EnableVirtualizationBasedSecurity" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "RequirePlatformSecurityFeatures" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "Locked" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Locked"

More info: Link

(*1) Adding VBS in Windows 11 can have a performance impact on the VM

  • Reboot the VM

  • When the VM is restarted run “msinfo32”
  • Scroll down and check if “Virtualization-Based Security” is running

Adding the PowerCLI script after the Packer deployment will enable vTPM and VBS for the Windows 11 VM. I hope the vTPM and VBS options will be added soon in Packer so we use the HCL config file without the need for an extra PowerCLI script.