Docker-OSX icon indicating copy to clipboard operation
Docker-OSX copied to clipboard

Amazon Linux problems...

Open AlexMcConnell opened this issue 5 years ago • 14 comments

Well, it's Amazon's own special implementation of Linux, so who knows if it's even possible to make this work, but...

SSH'd into my EC2 instance.

Ran:

sudo yum install libvirt qemu-kvm -y
sudo systemctl enable libvirtd.service
sudo systemctl enable virtlogd.service
sudo modprobe kvm

Exited and rebooted.

SSH'd back in, pulled the Docker image and ran: docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx

Failboat:

ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Unable to init server: Could not connect: Connection refused
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize kvm: No such file or directory

Other stuff:

$ egrep -c '(svm|vmx)' /proc/cpuinfo
0
$ ls -l /dev/kvm
ls: cannot access /dev/kvm: No such file or directory
$ pgrep -a X
$ echo $SHELL
/bin/bash
$ echo $DISPLAY

$

Is this due to not having a display? Is there a way around not having a display?

AlexMcConnell avatar Jul 10 '20 21:07 AlexMcConnell

I'm having this problem with the VNC version as well.

daraul avatar Jul 14 '20 17:07 daraul

99% chance that they do not support hardware nested virtualization

sickcodes avatar Jul 15 '20 05:07 sickcodes

Amazon Linux is actually Red Hat linux, so it will work.... but in this case, it's probably hardware nested virtualization that has been disabled.

Digital Ocean works

sickcodes avatar Jul 20 '20 19:07 sickcodes

I can confirm Digital Ocean works, I'm using that as I type this comment, but don't expect to use xcode. Apple blocks requests from DO droplets.

Not sure if/how I can enable hardware nested virtualization on AWS, but I'll definitely have a closer look at their RHEL AMIs

daraul avatar Jul 20 '20 20:07 daraul

I can confirm Digital Ocean works, I'm using that as I type this comment.

Not sure if/how I can enable hardware nested virtualization on AWS, but I'll definitely have a closer look at their RHEL AMIs

Haha excellent! 😝🚀🚀

sickcodes avatar Jul 20 '20 20:07 sickcodes

Is it expensive in DO? I want to have macOS ephimeral runners for my Gitlab CI/CD but an AWS metal instance is pretty much for my use case...

LcTrKiD avatar Jul 21 '20 06:07 LcTrKiD

The most economical way to do it is in the following way:

docker commit at the stage you want your machine, or copy the .img to somewhere.

Then use their API, or terraform, to run the server for the time required, and then delete it after.

sickcodes avatar Jul 21 '20 07:07 sickcodes

Is it expensive in DO? I want to have macOS ephimeral runners for my Gitlab CI/CD but an AWS metal instance is pretty much for my use case...

I am not familiar with their bare metals but it would probably work.

sickcodes avatar Jul 21 '20 07:07 sickcodes

@daraul were you able to run it on amazon linux?

ykhandelwal913 avatar Aug 11 '20 15:08 ykhandelwal913

@daraul were you able to run it on amazon linux?

@ykhandelwal913 it will run on bare metal only, source: https://www.reddit.com/r/aws/comments/eo85jr/ec2_instance_types_that_support_nested/

Edit: this thread could be old news though

sickcodes avatar Aug 11 '20 16:08 sickcodes

Thanks @sickcodes for prompt response. sorry for reopening the old thread.

ykhandelwal913 avatar Aug 11 '20 16:08 ykhandelwal913

I never got a chance to look at their RHEL AMI's @ykhandelwal913, but if I do I'll be back.

daraul avatar Aug 12 '20 01:08 daraul

If you are in the EU, Hetzner is a great host to use. They have servers in Germany and Finland. Super cheap prices. I have 10Gbps connection for €39 p/m (not including the server cost)

iambenmitchell avatar Aug 23 '20 19:08 iambenmitchell

If you are in the EU, Hetzner is a great host to use. They have servers in Germany and Finland. Super cheap prices. I have 10Gbps connection for €39 p/m (not including the server cost)

@iambenmitchell Sorry to ping you 5 years later, can you link me to the exact Hetzner product you used to deploy this on the cloud?

KStartups avatar Jul 25 '25 13:07 KStartups