Create a custom WorkSpaces image and bundle for WorkSpaces Personal

If you've launched a Windows or Linux WorkSpace and have customized it, you can create a custom image and custom bundles from that WorkSpace.

A custom image contains only the OS, software, and settings for the WorkSpace. A custom bundle is a combination of both that custom image and the hardware from which a WorkSpace can be launched.

Note

Ensure you wait at least 2 hours after deleting a bundle before creating a new bundle with the same name.

After you create a custom image, you can build a custom bundle that combines the custom image and the underlying compute and storage configuration that you select. You can then specify this custom bundle when you launch new WorkSpaces to ensure that the new WorkSpaces have the same consistent configuration (hardware and software).

You can use the same custom image to create various custom bundles by selecting different compute and storage options for each bundle.

Important

Custom bundles cost the same as the public bundles they are created from. For more information about pricing, see Amazon WorkSpaces Pricing .

Contents

Requirements to create Windows custom images

Note

Windows currently defines 1 GB as 1,073,741,824 bytes. Customers will need to ensure they have greater than 12,884,901,888 bytes (or 12 GiB) free on C drive and the user profile is less than 10,737,418,240 bytes (or 10 GiB) to create an image of a WorkSpace.

Requirements to create Linux custom images

Best practices

Before you create an image from a WorkSpace, do the following:

(Optional) Step 1: Specify a custom computer name format for your image

For the WorkSpaces launched from your custom or Bring Your Own License (BYOL) images, you can specify a custom prefix for the computer name format instead of using the default computer name format. To specify a custom prefix, follow the appropriate procedure for your image type.

Note

By default, the format of the computer name for Windows 10 WorkSpaces is DESKTOP-XXXXX and for Windows 11 WorkSpaces, WORKSPA-XXXXX .

  1. On the WorkSpace that you're using to create your custom image, open C:\ProgramData\Amazon\EC2-Windows\Launch\Sysprep\Unattend.xml in Notepad or another text editor. For more information about working with the Unattend.xml file, see Answer files (unattend.xml) in the Microsoft documentation.
Note

To access the C: drive from the Windows File Explorer on your WorkSpace, enter C:\ in the address bar.

Note
The and values in the section are ignored by Sysprep.
  1. If you are using Windows 10, open C:\Program Files\Amazon\Ec2ConfigService\Sysprep2008.xml in Notepad or another text editor. If you are using Windows 11, open C:\ProgramData\Amazon\EC2Launch\sysprep\OOBE_unattend.xml .
  2. In the section, uncomment * , and make sure that is set to an asterisk ( * ). If is set to any other value, your custom computer name settings will be ignored. For more information about the setting, see ComputerName in the Microsoft documentation.
  3. In the section, set and to your preferred values. During Sysprep, the values that you specify for and are concatenated together, and the first 7 characters of the combined string are used to create the computer name. For example, if you specify Amazon.com for and EC2 for , the computer names for the WorkSpaces created from your custom bundle will start with EC2AMAZ- xxxxxxx .
Note
The and values in the section are ignored by Sysprep.

Step 2: Run the Image Checker

Note

The Image Checker is available only for Windows WorkSpaces. If you are creating an image from a Linux WorkSpace, skip to Step 3: Create a custom image and custom bundle.

To confirm that your Windows WorkSpace meets the requirements for image creation, we recommend running the Image Checker. The Image Checker performs a series of tests on the WorkSpace that you want to use to create your image, and provides guidance on how to resolve any issues it finds.

Important

To get the Image Checker, do one of the following:

To run the Image Checker
  1. Open the C:\Program Files\Amazon\ImageChecker.exe file.
  2. In the Amazon WorkSpaces Image Checker dialog box, choose Run.
  3. After each test is completed, you can view the status of the test. For any test with a status of FAILED, choose Info to display information about how to resolve the issue that caused the failure. For more information about how to resolve these issues, see Tips for resolving issues detected by the Image Checker. If any tests display a status of WARNING, choose the Fix All Warnings button. The tool generates an output log file in the same directory where the Image Checker is located. By default, this file is located at C:\Program Files\Amazon\ImageChecker_ yyyyMMddhhmmss .log .
Tip
Do not delete this log file. If an issue occurs, this log file might be helpful in troubleshooting.

Tips for resolving issues detected by the Image Checker

In addition to consulting the following tips for resolving issues that are detected by the Image Checker, be sure to review the Image Checker log file at C:\Program Files\Amazon\ImageChecker_ yyyyMMddhhmmss .log .

Important

The PowerShell execution policy for a WorkSpace must be set to allow RemoteSigned scripts. To check the execution policy, run the Get-ExecutionPolicy PowerShell command. If the execution policy is not set to Unrestricted or RemoteSigned, run the Set-ExecutionPolicy –ExecutionPolicy RemoteSigned command to change the value of the execution policy. The RemoteSigned setting allows the execution of scripts on Amazon WorkSpaces, which is required to create an image.

Only the C and D drives can be present on a WorkSpace that's used for imaging. Remove all other drives, including virtual drives.

If there are problems with your Sysprep file, contact the AWS Support Center to get your EC2Config or EC2Launch repaired.

For Windows 7 WorkSpaces, the user profile ( D:\Users\ username ) must be less than 10 GB total. Remove files as needed to reduce the size of the user profile.

For Windows 7 WorkSpaces, you must have at least 12 GB of free space on drive C . Remove files as needed to free up space on drive C . For Windows 10 WorkSpaces, ignore if you receive a FAILED message and the disk space is above 2GB.

To run the Create Image process, no services on the WorkSpace can be running under a domain account. All services must be running under a local account.

To run services under a local account
  1. Open C:\Program Files\Amazon\ImageChecker_ yyyyMMddhhmmss .log and find the list of services that are running under a domain account.
  2. In the Windows search box, enter services.msc to open the Windows Services Manager.
  3. Under Log On As, look for the services that are running under domain accounts. (Services running as Local System, Local Service, or Network Service do not interfere with image creation.)
  4. Select a service that is running under a domain account, and then choose Action, Properties.
  5. Open the Log On tab. Under Log on as, choose Local System account.
  6. Choose OK.

You must configure all network adapters on the WorkSpace to use DHCP instead of static IP addresses.

To set all network adapters to use DHCP
  1. In the Windows search box, enter control panel to open the Control Panel.
  2. Choose Network and Internet.
  3. Choose Network and Sharing Center.
  4. Choose Change adapter settings, and select an adapter.
  5. Choose Change settings of this connection.
  6. On the Networking tab, select Internet Protocol Version 4 (TCP/IPv4), and then choose Properties.
  7. In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, select Obtain an IP address automatically.
  8. Choose OK.
  9. Repeat this process for all network adapters on the WorkSpace.

The Create Image process requires Remote Desktop Services to be enabled.

To enable Remote Desktop Services
  1. In the Windows search box, enter services.msc to open the Windows Services Manager.
  2. In the Name column, find Remote Desktop Services.
  3. Select Remote Desktop Services, and then choose Action, Properties.
  4. On the General tab, for Startup type, choose Manual or Automatic.
  5. Choose OK.

The WorkSpace that you're using to create images must have a user profile ( D:\Users\ username ). If this test fails, contact the AWS Support Center for assistance.

The environment variable path for the local machine is missing entries for System32 and for Windows PowerShell. These entries are required for Create Image to run.

To configure your environment variable path
  1. In the Windows search box, enter environment variables and then choose Edit the system environment variables.
  2. In the System Properties dialog box, open the Advanced tab, and choose Environment Variables.
  3. In the Environment Variables dialog box, under System variables, select the Path entry and then choose Edit.
  4. Choose New, and add the following path: C:\Windows\System32
  5. Choose New again, and add the following path: C:\Windows\System32\WindowsPowerShell\v1.0\
  6. Choose OK.
  7. Restart the WorkSpace.
Tip

The order in which items appear in the environment variable path matters. To determine the correct order, you might want to compare the environment variable path of your WorkSpace with one from a newly created WorkSpace or a new Windows instance.

The Create Image process requires the Windows Modules Installer service to be enabled.

To enable the Windows Modules Installer service
  1. In the Windows search box, enter services.msc to open the Windows Services Manager.
  2. In the Name column, find Windows Modules Installer.
  3. Select Windows Modules Installer, and then choose Action, Properties.
  4. On the General tab, for Startup type, choose Manual or Automatic.
  5. Choose OK.

The Create Image process requires the Amazon SSM Agent service to be disabled.

To disable the Amazon SSM Agent service
  1. In the Windows search box, enter services.msc to open the Windows Services Manager.
  2. In the Name column, find Amazon SSM Agent.
  3. Select Amazon SSM Agent, and then choose Action, Properties.
  4. On the General tab, for Startup type, choose Disabled.
  5. Choose OK.

To configure SSL/TLS for Windows, see How to Enable TLS 1.2 in the Microsoft Windows documentation.

There can be only one WorkSpaces user profile ( D:\Users\ username ) on the WorkSpace that you're using to create images. Delete any user profiles that don't belong to the intended user of the WorkSpace.

For image creation to work, your WorkSpace can have only three user profiles on it:

If there are additional user profiles, you can delete them through the advanced system properties in the Windows Control Panel.

To delete a user profile
  1. To access the advanced system properties, do one of the following:

One or more AppX packages are in a staged state. This might cause a Sysprep error during image creation.

To remove all staged AppX packages
  1. In the Windows search box, enter powershell . Choose Run as Administrator.
  2. When asked "Do you want to allow this app to make changes to your device?", choose Yes.
  3. In the Windows PowerShell window, enter the following commands to list all staged AppX packages, and press Enter after each one.
$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*") >
$packages | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue

Image creation is not supported on Windows systems that have been upgraded from one version of Windows 10 to a newer version of Windows 10 (a Windows feature/version upgrade).

To create images, use a WorkSpace that has not undergone a Windows feature/version upgrade.

The rearm feature allows you to extend the activation period for the trial version of Windows. The Create Image process requires that the rearm count be a value other than 0.

To check the Windows rearm count
  1. On the Windows Start menu, choose Windows System, then choose Command Prompt.
  2. In the Command Prompt window, enter the following command, and then press Enter. cscript C:\Windows\System32\slmgr.vbs /dlv

To reset the rearm count to a value other than 0, see Sysprep (Generalize) a Windows installation in the Microsoft Windows documentation.

Other troubleshooting tips

If your WorkSpace passes all of the tests run by the Image Checker, but you are still unable to create an image from the WorkSpace, check for the following issues:

Get-WmiObject -Class Win32_Service | Where-Object  $_.StartName -like "*$env:USERDOMAIN*" >
  1. In the Windows search box, enter services.msc to open the Windows Services Manager.
  2. In the Name column, find Windows Remote Management (WS-Management).
  3. Select Windows Remote Management (WS-Management), and then choose Action, Properties.
  4. On the General tab, for Startup type, choose Automatic.
  5. Choose OK.

Step 3: Create a custom image and custom bundle

After you have validated your WorkSpace image, you can proceed with creating your custom image and custom bundle.

To create a custom image and custom bundle
  1. If you are still connected to the WorkSpace, disconnect by choosing Amazon WorkSpaces and Disconnect in the WorkSpaces client application.
  2. Open the WorkSpaces console at https://console.aws.amazon.com/workspaces/ .
  3. In the navigation pane, choose WorkSpaces.
  4. Select the WorkSpace to open its details page and choose Create image. If the status of the WorkSpace is Stopped, you must start it first (choose Actions, Start WorkSpaces) before you can choose Actions, Create Image.
Note

To create an image programmatically, use the CreateWorkspaceImage API action. For more information, see CreateWorkspaceImage in the Amazon WorkSpaces API Reference.

Note

When entering an image description, make sure you don't use the special character "-" or you will get an error.

Note

To create a bundle programmatically, use the CreateWorkspaceBundle API action. For more information, see CreateWorkspaceBundle in the Amazon WorkSpaces API Reference.

Alternatively, you can expand the root and user volumes up to 2000 GB each.

Note

To ensure that your data is preserved, you cannot decrease the size of the root or user volumes after you launch a WorkSpace. Instead, make sure that you specify the minimum sizes for these volumes when launching a WorkSpace. You can launch a Value, Standard, Performance, Power, or PowerPro WorkSpace with a minimum of 80 GB for the root volume and 10 GB for the user volume. You can launch a Graphics.g4dn, GraphicsPro.g4dn, Graphics, or GraphicsPro WorkSpace with a minimum of 100 GB for the root volume and 100 GB for the user volume.

What's included with Windows WorkSpaces custom images

When you create an image from a Windows 7, Windows 10, or Windows 11 WorkSpace, the entire contents of the C drive are included.

For Windows 10 or 11 WorkSpaces, the user profile in D:\Users\ username is not included in the custom image.

For Windows 7 WorkSpaces, the entire contents of the user profile in D:\Users\ username are included, except for the following:

What's included with Linux WorkSpace custom images

When you create an image from an Amazon Linux WorkSpace, the entire contents of the user volume (/home) are removed. The contents of the root volume (/) are included, except the following applicable folders and keys, which are removed:

The following keys are shredded during custom image creation: