-
Notifications
You must be signed in to change notification settings - Fork 51
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
default: Warning: Remote connection disconnect. Retrying... #5
Comments
@junoteam You will need to change your invocation for starting the box slightly. It's discussed in this issue. You'll need to add docker.create_args = ["--cgroupns=host"] to your provider config. |
@junoteam Did @poolski suggestion work for you? Because it didn't work for me. I'm still on Big Sur but as soon as I upgraded to Docker 4.3 everything broke. Adding I'm going back to 4.2 for now. I'll try and investigate more as time permits. This isn't the first time Docker has broken M1 support so I am very reluctant to upgrade to newer versions. |
@rofrano @poolski Nope, this solution doesn't work. # Provider for Docker
config.vm.provider :docker do |docker, override|
override.vm.box = nil
docker.image = "rofrano/vagrant-provider:ubuntu"
docker.remains_running = true
docker.has_ssh = true
docker.privileged = true
docker.create_args = ["--cgroupns=host"]
docker.volumes = ["/sys/fs/cgroup:/sys/fs/cgroup:ro"]
end Error is the same. default: Port: 127.0.0.1:2200:22
default:
default: Container created: 167ec70eaf213446
==> default: Enabling network interfaces...
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
^C==> default: Waiting for cleanup before exiting...
Vagrant exited after cleanup due to external interrupt. The problem is, somewhere in the version of Docker. |
The same issue open in official docker for-mac repository: |
I have found a workaround.
To make it works, we need to run Ubuntu with at least this version root@ubuntu:~# systemctl --version
systemd 249 (249.5-2ubuntu1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP -LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified I fixed FROM ubuntu:jammy
LABEL MAINTAINER="John Rofrano <rofrano@gmail.com>" and # Provider for Docker
config.vm.provider :docker do |docker, override|
override.vm.box = nil
docker.image = "rofrano/vagrant-provider:ubuntu-jammy"
docker.remains_running = true
docker.has_ssh = true
docker.privileged = true
docker.volumes = ["/sys/fs/cgroup:/sys/fs/cgroup"]
end Now, if you wish to run Ubuntu 22:04 with Systemd installed without docker run -ti --privileged -v /sys/fs/cgroup:/sys/fs/cgroup rofrano/vagrant-provider:ubuntu-jammy Now it works. |
@junoteam This is not working with Vagrant for me. I updated my Docker image as you suggested and this is what I get when I execute % vagrant up (master)
Bringing machine 'default' up with 'docker' provider...
==> default: Creating and configuring docker networks...
==> default: Creating the container...
default: Name: vagrant-docker-provider_default_1639243346
default: Image: rofrano/vagrant-provider:ubuntu-jammy
default: Volume: /sys/fs/cgroup:/sys/fs/cgroup:ro
default: Volume: /Users/rofrano/GitHub/rofrano/vagrant-docker-provider:/vagrant
default: Port: 127.0.0.1:2222:22
default:
default: Container created: 381b80e2cf63b122
==> default: Waiting for container to enter "running" state...
The container started either never left the "stopped" state or
very quickly reverted to the "stopped" state. This is usually
because the container didn't execute a command that kept it running,
and usually indicates a misconfiguration.
If you meant for this container to not remain running, please
set the Docker provider configuration "remains_running" to "false":
config.vm.provider "docker" do |d|
d.remains_running = false
end If I try and run the container detached it does not keep running: % docker run -it --privileged -v "/sys/fs/cgroup:/sys/fs/cgroup:ro" -d rofrano/vagrant-provider:ubuntu-jammy
b7834a4f1e17e274dbacb6dd4274d14d679e5da31b53b5b5ba80f004a63ef4ac
% docker ps (master)
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES However. if I run my % docker run -it --privileged -v "/sys/fs/cgroup:/sys/fs/cgroup:ro" -d rofrano/vagrant-provider:debian
88a2a5a69f48bec382681760f5a6e74bf2e1050853fb4115ed89caced224695b
% docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88a2a5a69f48 rofrano/vagrant-provider:debian "/usr/sbin/init" 2 seconds ago Up 1 second 22/tcp quizzical_khayyam When you start the |
I added a lot of small fixes and changes. It's actually your repo, but I did customizations for my needs. |
BTW, docker just released version 4.3.1 with these notes in the changelog: Docker Desktop now uses Consider upgrading any |
Hello, Welcome to Ubuntu Jammy Jellyfish (development branch) (GNU/Linux 5.10.76-linuxkit x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
vagrant@ubuntu:~$ uname -a
Linux ubuntu 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
vagrant@ubuntu:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 5
On-line CPU(s) list: 0-4
Vendor ID: 0x00
Model: 0
Thread(s) per core: 1
Core(s) per socket: 5
Socket(s): 1
Stepping: 0x0
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2 frint
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Spec store bypass: Vulnerable
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Not affected
Srbds: Not affected
Tsx async abort: Not affected |
@junoteam Thanks for that update. Your files worked for me on my Intel Mac as well. I need to test on my M1 Mac and incorporate the changes that make ssh work again into my repo. |
@junoteam & @poolski , I have it all working now. I had to make the following changes to be compatible with updates that Docker Desktop 4.3 made to systemd support which now requires
A key thing that I missed at first was changing the If this fixes all of your problems let me know and I'll close this issue. It's working great on my M1 Mac. A HUGE THANKS for your support in helping me figure this out! |
Thank you @rofrano Small suggestion from my side. but this is only small suggestion :) |
@junoteam I tend to agree with you on using an LTS as the default ubuntu image. I've changed it to 21.04 because 22.04 doesn't install Docker automatically with vagrant yet (it fails with a Release not found error). Thanks for your input. |
Issue seems to be resolved with the latest changes. Closing. |
Hey, in some reason, it doesn't work anymore.
It fails with this error:
Laptop: MacBook Pro (14-inch, 2021)
OS: macOS Monterey 12.0.1
Docker version: 4.3.0 (71786)
When I log in with exec to container, I see that
systemd
isn't running.I am looking for the solution but didn't find yet.
On Linux it works fine:
@rofrano
The text was updated successfully, but these errors were encountered: