Troubleshoot desktop image Sysprep errors

Troubleshoot desktop image Sysprep errors

A key indicator of a Sysprep error with your desktop image is when the Set as image or Power off & set as image task displays the Error status.

This article provides best practices for preventing, troubleshooting, and resolving the Set as image or Power off & set as image (Sysprep) errors using Nerdio Manager.

Overview

During the Power off & set as image operation, Nerdio Manager completes the following tasks:

  1. Powers off the desktop image VM.

  2. Clones the OS disk and creates a new temporary VM.

  3. Powers on the new temporary VM.

  4. Removes local user accounts to prevent Sysprep from failing due to any per-user modern apps.

  5. Runs the Sysprep /generalize command on the temporary (cloned) VM.

  6. Waits for the Operating System to shut down.

  7. Captures a new version of the VM as an image.

  8. Depending on your selected options, Nerdio Manager completes this process in one of the following ways:

    • Updates the image version in your Azure Compute Gallery.

    • Creates a new image version while retaining the old version.

    • Deletes the old image version and replaces it with the new version.

  9. Deletes the temporary VM.

Check if the Power off & set as image process ends in an Error state at Step #6 with the following error:

Wait for Sysprep to complete (temp VM should automatically shut down).

If that is the case, then the Sysprep process failed, and the OS did not shut itself down automatically, as it would have if the Sysprep / generalize process had completed successfully.

Set as image: best practices and common mistakes

During the Set as image operation, a number of factors may cause errors. Review the following best practices and common mistakes to prevent typical Sysprep errors.

Note: The list below is not exhaustive, but it may help you prevent potential issues with the image Sysprep process.

Best practices:

  • Install Windows updates: Ensure your image is fully patched. If any additional updates are needed after your image is deployed, this minimizes the downtime. Occasionally, after the updates are installed, the image VM restart is required to make sure no additional updates are pending.

  • Use a single local admin account: Troubleshooting Sysprep errors is simpler when using a single account. If multiple users are signing in to the desktop image VM with different accounts, the number of potential problem areas increases.

  • Set up the local admin account in Nerdio Manager: During the Set as image process, Nerdio Manager removes all local accounts from the cloned image VM. However, Nerdio Manager can automatically create a local admin account on all provisioned VMs. For this, you need to set up a local admin account in Settings > Portal > Local administrator credentials.

  • Validate your image: Nerdio Manager allows you to ensure that your image operates as expected prior to deploying it. Before you start the Set as image process, select the Validate image option. For details, see Overview of Boot Diagnostic Insights.

  • Configure notifications for the Power off & set as image failures: Notifications help you ensure you are aware of the issue before your customer notifies you. Set up notifications for any Set as image errors. For details, see Alerts and Notifications.

Common mistakes:

  • Don't join desktop images to your Identity provider: Images that are joined to the domain can cause unexplained issues and errors before they are Sysprepped. If there is software that requires a domain connection, wait until the image is deployed to the host pool VMs, and then deploy that software to the host VMs.

  • Don't install apps from the Microsoft Store or in a per-user context: During the Sysprep process, per-user apps are deleted. Even though all local users are removed from the VM before Sysprep, the apps remain and prevent Sysprep from completing successfully. If apps need to be installed, use the following installation methods:

  • Don't install your security software directly on the image: While some security tools may survive the Sysprep process, in most cases they interfere with it and cause errors during generalization or new host deployment. The best approach is to deploy these tools during the VM deployment process.

  • Don't manually Sysprep your desktop image VM: Sysprepping an Azure VM makes that VM unusable in Azure. That is one of the reasons Nerdio Manager clones the VM, and then Syspreps the clone.

  • Don't enable BitLocker: When BitLocker is enabled, the Sysprep process cannot be completed successfully because the OS disk is encrypted, and it is unable to disable BitLocker.

Determine the cause of the Sysprep failure

Once you are certain that the issue occurred, the next step is to review the logs and ensure that the error is caused by the Sysprep process.

To download logs in Nerdio Manager:

  1. Go to Desktop images.

  2. In the Desktop images tasks pane, next to the task whose details you wish to review, select Details.

  3. Scroll down until you can see the Error status, and then select Download logs.

    The Sysprep logs from the temporary VM are downloaded.

    Note: Alternatively, go to %WINDIR%\System32\Sysprep\Panther on the temporary VM to view the log files.

  1. In Nerdio Manager, next to the failed task, select Cleanup to prevent the temporary VM from lingering and incurring unnecessary costs.

Once you have downloaded the log file, you can review it to identify the error.

To identify the error in the log file:

  1. Open the setupact.log file and scroll down to locate the Error entry.

    In the case of Sysprep errors, the first error typically identifies the root cause of the failure. Additional errors may be displayed, but they are usually secondary effects stemming from the initial issue.

  2. Review the error details to determine how to resolve it.

    For details of common Sysprep errors and their resolution steps, see Resolve the error.

Review the example below. You can see that the first error is the following:

Error SYSPRP Package AdobeNotificationClient_3.0.1.1_x86__enpm4xejd91yc was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

Resolve the error

The table below provides the most common Set as image errors.

Error

Cause

Resolution

SYSPRP BCD: BiUpdateEfiEntry failed c000000d

There are pending Windows updates that require restarting the desktop image VM.

To resolve the error:

  1. Manually start the desktop image VM.

  2. Ensure there are no pending Windows updates.

  3. Restart the desktop image VM.

  4. Run the Power off & set as image process once again.

SYSPRP Package <packagefullname> was installed for a user, but not provisioned for all users.

An application was installed in the per-user context, and it cannot be removed.

To resolve the error:

  1. Start the desktop image VM.

  2. Edit the command below to include the package name (in quotation marks) from the error:

    Get-AppXPackage -AllUsers | Where Name -like "AdobeNotificationClient*" | Remove-AppXPackage -AllUsers

  3. Run the command on the image VM.

SYSPRP BitLocker-Sysprep: BitLocker is on for the OS volume. Turn BitLocker off to run Sysprep.

BitLocker is enabled on one or more desktop image drives.

To resolve the error:

  1. Disable BitLocker on the desktop image VM.

  2. Run the Power off & set as image process once again.

Remove-AppXPackage: The remote procedure call failed.

Typically, this error occurs because the desktop image was joined to an Identity provider, such as Active Directory, Microsoft Entra ID, or Microsoft Entra Domain Services, and the account that is attempting to run a Remove-AppXPackage command doesn’t have the appropriate permissions.

To resolve the error:

  1. Review the C:\Users directory for all accounts that have signed in to the image.

  2. Sign in with each account until you are able to successfully run your Remove-AppXPackage command.

Error in executing action for Windows-SenseClient-Service

Windows Defender for ATP, and its associated policies, have been deployed on the source image.

For resolution details, see Troubleshoot Sysprep and Windows Defender ATP.

Error: Object reference not set to an instance of an object.

This is Nerdio Manager's generic error that occurs when you run the Power off & set as image process with an unknown version of Windows in Nerdio Manager.

To resolve the error, do one of the following:

  • Manually clone the image VM, and then Sysprep the clone in the Azure portal.

  • Wait until the version of Windows is supported in Nerdio Manager.

Was this article helpful?

1 out of 1 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Please sign in to leave a comment.