Sysprep command on AWS ec2 windows
I recently ran sysprep command on ec2 vm running windows server. (sysprep.exe /oobe /generalize /shutdown which was provided by one of the popular AI/chat tools). The sysprep command ran fine. The initial intent was to create an AMI from this instance. After sysprep command completed the ec2 instance stopped and next followed steps for creating an AMI. Steps were straight forward no issues. After I started this ec2 vm via AWS console, it showed as successfully started- however I could not rdp into this server. Looks like sysprep command has caused this issue. I got the system log for this ec2 instance (it is available via the AWS console) and it shows as below Windows is being configured. 'SysprepState=IMAGE_STATE_UNDEPLOYABLE' This means that rdp into this instance will not be possible. Essentially when you run Sysprep (especially with the /generalize and /oobe switches) on an EC2 instance, you are resetting Windows back to a state where it’s expecting to run first-boot co...