ImageBuilder - Password was reset?

0

I'm trying to use ImageBuilder to update our Windows Server 2022 based AMI. Our image recipe runs one component (update-windows) and then we run a simple boot test. For some reason the Administrator password in the resulting image seems to have changed and so I can't RDP in. When I attach the volume to another instance, it looks correct, so it's not like it's using an unexpected snapshot somehow. What am I missing here? Thank you

  • When you say the Administrator password looks correct, are you able to RDP into the other instance with the attached volume that is using the new AMI? Is there a specific error you are getting when you attempt to RDP into the instance using the new AMI? (i.e. The Username or Password is Incorrect.)

SM
asked 10 months ago531 views
2 Answers
1
Accepted Answer

Hello, so this is by design when you build an Image via EC2 Image Builder as part of the final build steps AWS EC2 Image Builder runs Microsoft Sysprep this is done to generalize your image so that it can be deployed as a golden image for multiple EC2 Instances. Part of the Sysprep process by default for EC2Launch V2 which is used by Windows Server 2022 will reset the Administrator password to use the EC2 key pair that is assigned when launching a new image using the outputted AMI by EC2 Image Builder. If you are providing a custom AMI and then using the component update-windows this will run Microsoft updates but as part of the build workflow there is a step "RunSysPrepScript" that is executing sysprep that will reset the Administrator password.

To be able to connect to your Instances that are launched from the AMI that was created by Image Builder assign a key pair when creating the instance and use that to decrypt the Administrator password to login. As per this documentation. For some additional information regarding sysprep for image builder refer to this documentation and in general for creating customizable sysprep images refer to these articles

https://repost.aws/knowledge-center/sysprep-create-install-ec2-windows-amis https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.html#ami-create-standard

AWS
Peter_B
answered 10 months ago
1

What happens if I do something like get the initial password for Windows?
https://repost.aws/knowledge-center/retrieve-windows-admin-password

profile picture
EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions