Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only shows a blue screen when running in an EC2 instance #204

Open
mcleantom opened this issue Jul 8, 2024 · 0 comments
Open

Only shows a blue screen when running in an EC2 instance #204

mcleantom opened this issue Jul 8, 2024 · 0 comments

Comments

@mcleantom
Copy link

image

I am trying to run the container in an EC2 instance based on this packer.json file:

{
  "variables": {
    "region": "eu-west-2",
    "instance_type": "t3.medium",
    "ami_name": "docker-vnc-test-{{timestamp}}"
  },
  "builders": [
    {
      "type": "amazon-ebs",
      "region": "{{user `region`}}",
      "instance_type": "{{user `instance_type`}}",
      "source_ami_filter": {
        "filters": {
          "virtualization-type": "hvm",
          "name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*",
          "root-device-type": "ebs"
        },
        "owners": ["099720109477"],
        "most_recent": true
      },
      "iam_instance_profile": "admin",
      "ssh_username": "ubuntu",
      "ami_name": "{{user `ami_name`}}"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "sudo apt-get update",
        "sudo apt-get install -y unzip",
        "curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"",
        "unzip awscliv2.zip",
        "sudo ./aws/install",
        "sudo apt-get update",
        "sudo apt-get install -y ca-certificates curl",
        "sudo install -m 0755 -d /etc/apt/keyrings",
        "sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc",
        "sudo chmod a+r /etc/apt/keyrings/docker.asc",
        "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null",
        "sudo apt-get update",
        "sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin",
        "sudo usermod -aG docker ubuntu",
        "sudo systemctl enable docker",
        "sudo chown $USER /var/run/docker.sock",
      ]
    }
  ]
}

And then I start an instance based on that ami image by going into it and running:

docker run -it -p 5901:5901 -p 6901:6901 -e VNC_PASSWORDLESS=true consol/rocky-xfce-vnc

But when I go onto it, it just shows a blank blue screen. Works fine on my laptop. Is there anything I need to add to make it work on this ec2 instance? Is it because the ec2 instance doesn't have things installed that the docker container needs? Any help would be appreciated, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant