I'm using packer to provision a custom AMI starting from "Ubuntu Server 18.04 LTS (HVM), SSD Volume Type" (ami-03ba3948f6c37a4b0).

Based on a fair amount of trial and error, it seems I can provision all the packages and configuration I need except the ubuntu-desktop package. As soon as I add ubuntu-desktop to the configuration, the resulting AMI boots but fails its status check, and cannot be reached via any of the available methods ( ssh , the AWS web-based session manager, nor EC2 instance connect). Without ubuntu-desktop I can ssh into the instance just fine, which tells me I've got keys and security groups setup in such a way that I should be able to connect.

I've narrowed down the problem further ... if I install only gdm3 , gnome-session , gnome-terminal , and yes even the binary NVIDIA driver, the resulting AMI does boot AND is reachable, and after installing a remote desktop I can interact with the (very limited) desktop environment. I can even install ubuntu-desktop manually in that instance and reboot it to get a fully functioning desktop.

I don't see anything remarkable in the packer build log or the EC2 system log.

Thoughts? I'm not sure how to debug this, actually, because the instance isn't reachable and I don't see any obvious errors.