By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How can I use Sysprep to create and install custom reusable Windows AMIs?

2 minute read
0

I want to use Sysprep to capture and install a custom reusable Windows Amazon Machine Image (AMI).

Resolution

Before you run Sysprep, review the following points:

  • 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.
  • 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 2022, 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).

Run Sysprep with EC2Config or EC2Launch v1 or v2

  1. Open the Amazon EC2 console, and then connect to your Windows EC2 instance using Remote Desktop Protocol (RDP).
  2. From the Windows Start menu, complete the following steps:
    For Windows Server 2008 through Windows Server 2012 R2, open EC2ConfigService Settings, and then choose Image.
    For Windows Server 2016 or later, open EC2LaunchSettings.
  3. For Administrator Password, choose Random.
  4. Choose Shutdown with Sysprep, then choose Yes.
    Note: You must retrieve the new password from the console on the next boot.
  5. Open the Amazon EC2 console, and then choose Instances from the navigation pane.
  6. After the instance state changes to stopped, select your instance.
  7. For Actions, choose Image, and then Create image.
    For Image name, enter a name.
    For Image description, enter a description.
  8. Choose Create image.

For more information and customization options, see Create an AMI with Windows Sysprep.

If you receive error messages, then see Troubleshoot Sysprep issues with Windows instances. You can also use EC2Rescue for Windows Server to collect log files and troubleshoot any issues.

Related information

How do I launch an EC2 instance from a custom AMI?

Why can't I launch EC2 instances from my copied AMI?

3 Comments

If the goal is to create good images from EC2 Instances in production then why do you recommend not using Sysprep in production system?

replied 8 months ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERATOR
replied 8 months ago

I followed these exact steps but when launching an image from my custom AMI, I cannot RDP into it.

replied 8 days ago