Sysprep or Guest OS Customization Failure 0x422 - Windows 11 and Windows Server 2025
search cancel

Sysprep or Guest OS Customization Failure 0x422 - Windows 11 and Windows Server 2025

book

Article ID: 436201

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

While running sysprep:

The following errors are observed in the `C:\Windows\System32\Sysprep\Panther\setuperr.log` file:

  • Error SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralizeValidate' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x422
  • Error SYSPRP Package [PackageName] was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image. Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.`

Environment

  • ESXi 8.x
  • ESX 9.x
  • vCenter 8.x
  • vCenter 9.x

Cause

These errors typically occur due to two primary reasons:

1.  Service State (0x422):** The `AppXSvc` (AppX Deployment Service) is disabled. Sysprep requires this service to be in a Manual or Automatic start state to validate and clean up AppX packages during the generalize phase
2.  Package Conflict (0x80073cf2):** Certain Microsoft Store (AppX) applications are installed for a specific user but are not provisioned for all users, or are flagged as "protected" (Inbox) apps that cannot be removed by standard commands

Resolution

To resolve these issues, follow the steps below on the base image before converting it to a template :

  1. Enable the AppX Deployment Service
    Note: The registry command provided is accurate for setting the service to "Manual" (Value 3): 
  2. Open an elevated command prompt (Run as Administrator) and run the command below.
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\AppXSvc" /v "Start" /t REG_DWORD /d 3 /f
    Note: If the value was 4 (Disabled), changing it to 3 (Manual) allows Sysprep to trigger the service as needed.

Alternatively, use the GUI to modify the service startup type :

  1. Open the run prompt using windows+r key and type regedit
    browse to the location below.
    HKLM\SYSTEM\CurrentControlSet\Services\AppXSvc
  2. On the right-hand side, double-click on the start up type and change the value to 3.
    see the screenshot below for the reference


Once the service is enabled, run Sysprep:

This command will make changes to your system. Review it carefully before running.

To reboot the system from the command prompt:

C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown

If Sysprep fails again, re-examine the `setuperr.log` for any additional packages that may need to be removed.

Additional Information

Refer to KB articles for sysprep log files.

Locations of sysprep log files

Customization Specification for Windows does not join VM to domain