Score:0

Cannot SSH into AWS E3 AMI (Ubuntu 18.04) after ubuntu-desktop installed

th flag

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.

AWS Console Screenshot

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!

Tim avatar
gp flag
Tim
I would enable SSM agent, make sure SSM is working properly (it takes a bit of tweaking sometimes), take the image and create the instance, then log in with session manager to do diagnostics.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.