Skip to content

Unable to image 2022 or 2025 Win workspace

0

I have created both a 2022 and 2025 windows Power Workspace. The image fails for both and AWS recommends running image checker. Running the image checker for both environments results in this warning: "One or more AppX packages are in a staged state. This might cause a Sysprep error" There are several suggestions on line however none of the recommended action using Powershell have worked.

Has anyone had success resolving this issue and what steps did you take?

asked 2 months ago183 views

2 Answers
0

The AppX package staging warning you're encountering is a known issue that can prevent successful image creation for Windows WorkSpaces. Here are the steps to resolve it:

First, you need to remove the problematic AppX packages. Use the PowerShell cmdlet Remove-AppxPackage to uninstall the staged packages. If the standard removal commands aren't working, you may need to identify which specific AppX packages are causing the issue and remove them individually.

During the BYOL import process, some offending AppX packages are automatically cleaned up, but if the image creation continues to fail, you'll need to manually remove them. Make sure you're running PowerShell with administrator privileges when attempting the removal.

Additionally, ensure that your WorkSpace meets all other prerequisites for image creation. The Image Checker performs multiple tests, and all failures and warnings must be resolved before an image can be successfully created. Continue running the Image Checker after each remediation attempt until you receive a "Validation Successful" message.

If you've tried the standard PowerShell removal commands without success and the issue persists, you may need to contact AWS Support for assistance with identifying the specific packages causing the problem or for guidance on alternative removal methods specific to Windows Server 2022 and 2025 environments.
Sources
Troubleshooting A WorkSpace custom image creation error - Best Practices for Deploying WorkSpaces
List of SysPrep error messages and error fixes - Amazon WorkSpaces

answered 2 months ago

AWS
SUPPORT ENGINEER

reviewed 2 months ago

  • The Appx packages are required and cannot be removed, so this soplution is not viable.

0

The most useful move here is to stop guessing at which packages are the problem and read the Sysprep log, which names them explicitly.

Get the actual offending package

C:\Windows\System32\Sysprep\Panther\setupact.log

Look for lines like:

Error SYSPRP Package <Name>_<Version>_<Arch>__<PublisherId> was installed
for a user, but not provisioned for all users.
Error SYSPRP Failed to remove apps for the current user: 0x80073cf2

That names the specific package. Every generic cleanup script is a guess until you have that. The failure is also nearly always 0x80073cf2 — confirming that tells you you're chasing the right thing.

Why the PowerShell you've tried probably didn't work

The commands circulating online mostly miss on one of three points.

-AllUsers is needed on both sides. Get-AppxPackage -AllUsers | Remove-AppxPackage still removes only for the current user. The removal needs the switch too:

Get-AppxPackage -AllUsers <PackageFullName> | Remove-AppxPackage -AllUsers

Running as the WorkSpace user isn't enough. AWS's documented step for the staged-package case specifies executing with elevated SYSTEM privileges, not just administrator. Use PsExec (psexec -s -i powershell.exe) or a scheduled task running as SYSTEM.

Staged packages belong to profiles that may no longer exist. Enumerate them directly:

Get-AppxPackage -AllUsers | Where-Object {
    $_.PackageUserInformation -match "Staged"
} | Select-Object Name, PackageFullName, PackageUserInformation

That last column tells you which SID holds it. If the SID maps to a deleted profile, no per-user removal will reach it — you'll need to clear the stale profile from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and the corresponding C:\Users folder first.

The AWS-documented escalation

If the targeted removal still fails, the documented fallback is to strip everything:

Get-AppxProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue

Then re-run Image Checker. -ErrorAction SilentlyContinue matters — framework and system packages will refuse removal and abort the pipeline otherwise.

The reason it keeps coming back

This is what usually defeats people on the second attempt. Microsoft Store auto-updates re-stage packages between your cleanup and the image capture, so a WorkSpace that passed Image Checker fails at Sysprep an hour later.

Disable it before cleaning up, not after:

HKLM\SOFTWARE\Policies\Microsoft\WindowsStore
AutoDownload (DWORD) = 2

Then reboot, clean up, run Image Checker, and capture in one sitting. Don't let the WorkSpace sit overnight between steps.

If you're still blocked

Consider starting from a brand-new WorkSpace, applying the Store policy and cleanup before installing anything or letting Windows Update run, verifying Image Checker passes, and only then layering on your customisations. Fewer accumulated profiles and update cycles means fewer staged packages to fight.

One other thing worth ruling out: image creation isn't supported on Windows that has undergone a feature/version upgrade. If either WorkSpace was built on one image version and upgraded, that's a separate hard blocker that no AppX cleanup will resolve.

Finally — Windows Server 2025 bundles are relatively new. If 2022 eventually succeeds and 2025 still fails with identical cleanup, that asymmetry is worth raising with AWS Support directly rather than continuing to troubleshoot, since it would point at the bundle rather than your configuration.

EXPERT

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.