I tried to create an Amazon WorkSpaces bring your own license (BYOL) image, but it failed.
Resolution
Check your configurations
Make sure that your virtual machine (VM) runs a supported Windows version.
Connect to the VM in the on-premises environment. To verify that your image meets all requirements, download and run the BYOL Checker PowerShell script. The script provides a detailed report of issues that you must correct before image creation and generates two log files: BYOLPrevalidationlogYYYY-MM-DD_HHmmss.txt and ImageInfo.text. You can find these files in the directory that contains the BYOL Checker script files. To troubleshoot common BYOL image creation errors, see List of error messages and error fixes.
Important: All BYOL Checker script tests must pass for the WorkSpaces image validation to succeed.
The source machine must have English (United States) as the primary language for the Windows operating system. To check the current language, run the following PowerShell command:
Get-WinSystemLocale
If your imported BYOL image has a firewall, then use the VM to check that the firewall isn't blocking any required ports.
Before you import the VM into Amazon Elastic Compute Cloud (Amazon EC2), check that your configuration adheres to the VM import and export requirements. Make sure that the disk that you use to import the VM isn't encrypted. Also, make sure that your VM volume size adheres to the BYOL size restrictions. If you plan to use Microsoft Office for your BYOL image, then you must adhere to additional requirements for your VM.
Check that your VM is compatible with Sysprep
All applications installed on your source VM must be compatible with Sysprep. If Sysprep fails and you receive the "One or more AppX package are in a staged state" error, then image creation fails. To list all installed AppX packages, run the following PowerShell command:
Get-AppxPackage -AllUsers | Format-List -Property PackageFullName,PackageUserInformation
All users must have Modern AppX Packages uninstalled. For more information , see Sysprep fails after you remove or update Microsoft Store apps that include built-in Windows images on the Microsoft website.
To remove the AppX Packages, complete the following steps:
-
In the Windows search box, enter PowerShell.
-
Choose Run as Administrator.
-
For Do you want to allow this app to make changes to your device?, choose Yes.
-
To list all staged AppX packages, run the following PowerShell commands.
Note: Press Enter after you enter each command.
$workSpaceUserName = $env:username
$allAppxPackages = Get-AppxPackage -AllUsers
$packages = $allAppxPackages | Where-Object { `
(($_.PackageUserInformation -like "*S-1-5-18*" -and !($_.PackageUserInformation -like "*$workSpaceUserName*")) -and `
($_.PackageUserInformation -like "*Staged*" -or $_.PackageUserInformation -like "*Installed*")) -or `
((!($_.PackageUserInformation -like "*S-1-5-18*") -and $_.PackageUserInformation -like "*$workSpaceUserName*") -and `
$_.PackageUserInformation -like "*Staged*")
}
-
To remove all staged AppX packages, enter the following command, and then press Enter:
$packages | Remove-AppxPackage -ErrorAction SilentlyContinue
-
To verify your checks, run the BYOL Checker on the source VM.
-
If the verification fails, then to remove all AppX packages, enter the following commands.
Note: Press Enter after you enter each command.
Get-AppxProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue
Check your IAM permissions
After you create the image, make sure that you have the necessary AWS Identity and Access Management (IAM) permissions to import the image. Make sure that the launch permissions on the Amazon EC2 image aren't restricted. The image must be shareable throughout the BYOL image creation process.
Check the ingestion process (AWS CLI only)
If image creation fails when you use the AWS Command Line Interface (AWS CLI) to create an image, then verify the image ingestion process. The ingestion process must match the protocol that you use for WorkSpaces.
Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.