Error: ShellHost.exe during Windows 11 Guest OS Customization
search cancel

Error: ShellHost.exe during Windows 11 Guest OS Customization

book

Article ID: 390487

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

When deploying Windows 11 virtual machines from templates with Guest OS Customization enabled in vCenter, the Windows desktop fails to load after login. Instead, a ShellHost.exe error message appears repeatedly, preventing normal system operation. Manual sysprep works correctly, but the automated customization through vCenter fails.

C:\Windows\panther\setuperr.log will contain the following errors:

  • BiUpdateEfiEntry failed c000000d
  • BiExportBcdObjects failed c000000d
  • BiExportStoreAlterationsToEfi failed c000000d
  • Failed to export alterations to firmware. Status: c000000d

These errors indicate that the sysprep process is failing to properly configure the boot settings required for the guest OS.

Environment

  • Windows 11 Enterprise
  • vCenter Server 7.x / 8.x
  • Omnissa Horizon VDI
  • VM version 21 (ESXi 8.0 U2 and later)

Cause

This behavior is caused by a Microsoft Windows issue in the sysprep process when using the `/generalize` option. The issue results in incorrect Boot Configuration Data (BCD) settings after the generalize process completes, preventing the guest OS from configuring boot settings required for customization.

Resolution

VMware engineering has been collaborating with Microsoft on this issue. In the meantime, the following workaround has been confirmed:

Workaround: BCD Repair Script (SetupComplete.cmd)

Follow these steps to repair the BCD entries automatically after the Sysprep process:

  1. Open the Windows VM used for the template.
  2. Create the following directory if it is not present: C:\Windows\Setup\Scripts\
  3. Create a file named SetupComplete.cmd in that directory.
  4. Edit the file and add these commands:
    bcdedit -set {current} osdevice partition=C:
    bcdedit -set {current} device partition=C:
    bcdedit -set {memdiag} device partition=\Device\HarddiskVolume1
  5. Save the file and power off the VM.
  6. Convert the VM to a template and attempt deployment with Guest OS Customization.

Note: Subscribe to this article to be updated on the fix status of this issue (Reference: Subscribe to a Broadcom knowledge article by article or product).

Additional Information