How can I use Sysprep to create and install custom reusable Windows AMIs?
Last updated: 2019-03-25
I want to use Sysprep to capture and install a custom reusable Windows Amazon Machine Image (AMI). How can I do this?
Sysprep is a Microsoft tool that is used to capture custom Windows images. Sysprep removes unique information from the Amazon Elastic Compute Cloud (Amazon EC2) Windows instance, including the instance security identifiers (SID), computer name, and drivers. Duplicate SIDs can cause issues with Windows Server Update Services (WSUS), log-in issues, Windows volume key activation, Microsoft Office, and third-party products.
Consider the following before running Sysprep:
- Don't use Sysprep to create a backup for your instance.
- Don't run Sysprep on a production system.
- Sysprep isn't supported on Windows Server 2016 Nano Server.
- Use EC2Config for Windows Server 2008 through Windows Server 2012 R2.
- Run Sysprep with EC2Launch for Windows Server 2016 or later.
Run Sysprep with EC2Config or EC2Launch
- Open the Amazon EC2 console, and then connect to your Windows EC2 instance using Remote Desktop Protocol (RDP).
Note: To create a standard custom image without Sysprep, see Create a Windows AMI from a Running Instance. Be sure to note the AMI ID.
- From the Windows Start menu:
For Windows Server 2008 through Windows Server 2012 R2, open EC2ConfigService Settings, and then choose the Image tab.
For Windows Server 2016 or later, open EC2 Launch Settings.
- For Administrator Password, choose Random.
- Choose Shutdown with Sysprep.
- Choose Yes.
Note: You must retrieve the new password from the EC2 console on the next boot.
- Open the Amazon EC2 console and choose Instances from the navigation pane.
- After the instance state changes to stopped, select your instance.
- For Actions, choose Image, 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 a Standard Amazon Machine Image Using Sysprep.
If you receive error messages or experience issues when using Sysprep, see Troubleshooting Sysprep.
You can also use EC2Rescue for Windows Server to collect log files and troubleshoot issues.