I am trying to build a standard desktop AMI image on AWS that I can launch on a new EC2 instance when I need it.
The issue I am experiencing is that when I make an AMI from a perfectly working instance and I launch a new instance with it - it fails on the instance status check. The new instance is unreachable and doesn't respond at all to ping or ssh.
I've managed to distil the issue right down to installing ubuntu-desktop. So a brand new instance with Ubuntu 18.04 creates a usable image but as soon as I install ubuntu-desktop and create a new image it becomes un-connectable.
There are no errors in the system logs that AWS provides and I am even able to view the screen capture which shows the login screen for gnome. I have compared the cloud init system logs section by section between the original instance and the new instance (which I pulled by detaching the volume) and from what I can tell it's business as usual.
Some other things I have tried with no luck;
- Turned on automatic login
- Allowed all inbound traffic
- Disabling the AWS SSM Agent
Ubuntu-desktop appears to be upsetting the network initialising process that AWS performs on new instances. The original instance works 100% and can be turned off and on without any issues. It's just the image of that instance that becomes un-connectable.
Edit - I can confirm that the issue is specific to Ubuntu 18.04. Images made with Ubuntu 20.04 work exactly as expected - responsive and connectable.
I'm out of ideas!
Thanks in advance!