I want to use System Preparation (Sysprep) to capture and install a custom reusable Windows Amazon Machine Image (AMI).
Resolution
When you run Sysprep, use the following best practices:
- Don't use Sysprep to create a backup for your instance.
- Don't run Sysprep on a production system.
- Windows Server 2016 Nano Server doesn't support Sysprep.
- For Windows Server 2008 through Windows Server 2012 R2, run Sysprep with EC2Config.
- For Windows Server 2016 or Windows 2019 (LTSC and SAC), run Sysprep with EC2Launch v1.
- For Windows Server 2022 and Windows Server 2025, run Sysprep with EC2Launch v2. You can also use EC2Launch v2 for Windows 2012, 2012 R2, 2016 (LTSC and SAC), or 2019 (LTSC and SAC).
Note: For more information, see Limitations on the Microsoft website. To capture a Sysprep image of a production system, create an AMI from the instance. Then, launch the instance from the AMI in an isolated environment. You can capture a Sysprep image of the launched instance.
Run Sysprep with EC2Config or EC2Launch v1 or v2
Complete the following steps:
- Open the Amazon Elastic Compute Clouse (Amazon EC2) console.
- Use Remote Desktop Protocol (RDP) to connect to your Windows instance.
- Choose the Windows Start menu, and then complete one of the following steps for the Windows Server that you use:
For Windows Server 2008 through Windows Server 2012 R2, open EC2ConfigService Settings, and then choose Image.
For Windows Server 2016 or later, open EC2LaunchSettings.
- For Administrator Password, choose Random.
- Choose Shutdown with Sysprep, and then choose Yes.
Note: You must retrieve the new password from the console the next time that you boot.
- Open the Amazon EC2 console.
- In the navigation pane, choose Instances.
- After the instance state changes to stopped, select your instance.
- For Actions, choose Image, and then choose Create image.
- For Image name, enter a name.
- For Image description, enter a description.
- Choose Create image.
For more information and customization options, see Create an Amazon EC2 AMI using Windows Sysprep.
If you receive error messages, then see Troubleshoot Sysprep issues with Amazon EC2 Windows instances. You can also use EC2Rescue for Windows Server to collect log files and troubleshoot any issues.
Related information
Why can't I launch EC2 instances from my copied AMI?