colima: Failed to start colima ssh connection refused

I can’t seem to start colima for the first time. Looks like ssh trying to connect on a ephemeral port being refused. But maybe this is a qemu problem. Any insight would be appreciated

lima version 0.8.2 colima version 0.3.2 QEMU emulator version 6.2.0 Mac M1

INFO[0000] starting colima                              
INFO[0000] creating and starting ...                     context=vm
> msg="Terminal is not available, proceeding without opening an editor"
> msg="Attempting to download the image from \"https://github.com/abiosoft/alpine-lima/releases/download/colima-v0.3.2/alpine-lima-clm-3.14.3-x86_64.iso\"" digest="sha512:875482176ff2f43bf9472f84137d8b9a56d692ae19243436079c7f2f78cb6b13576601eef9102aaea796629215fc60308e69b590c81fe4139e9e84f1ec4a57f5"
> msg="Using cache \"/Users/kbowerma/Library/Caches/lima/download/by-url-sha256/2001a61186d9a6a460637e4b69dec0b002ea5cffbaeac9ca590771f129e1ab79/data\""
> msg="[hostagent] Starting QEMU (hint: to watch the boot progress, see \"/Users/kbowerma/.lima/colima/serial.log\")"
> msg="SSH Local Port: 49844"
> msg="[hostagent] Waiting for the essential requirement 1 of 5: \"ssh\""
> msg="[hostagent] QEMU has exited"
> msg="exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see \"/Users/kbowerma/.lima/colima/ha.stderr.log\")"

stderror log …

{"level":"debug","msg":"executing script \"ssh\"","time":"2022-02-09T08:07:55-06:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/kbowerma/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=kbowerma -o ControlMaster=auto -o ControlPath=\"/Users/kbowerma/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 49844 127.0.0.1 -- /bin/bash]","time":"2022-02-09T08:07:55-06:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 49844: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 49844: Connection refused\\r\\n\": exit status 255","time":"2022-02-09T08:07:55-06:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: Error: HV_ERROR","time":"2022-02-09T08:07:55-06:00"}
{"error":"signal: abort trap","level":"info","msg":"QEMU has exited","time":"2022-02-09T08:07:55-06:00"}

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 4
  • Comments: 31 (9 by maintainers)

Most upvoted comments

What worked for me is rm -rf ~/.colima then colima start

@kbowerma you’re on an m1 device, so that is expected. You probably have your arch set to x86 for your initial colima instance for whatever reason. Can you colima delete and colima start?

If it still fails, explicitly set the arch to aarch64 with colima start --arch aarch64.

Same problem, different cause and solution.

It was nothing to do with the architecture mismatch for me, but rather brew sources. I ran brew upgrade, and had the same errors as above afterwards. I tried everything mentioned here, and in other tickets (there are dupes in the upstream lima project).

Solution for me in the end was:

brew uninstall --zap qemu colima lima
brew upgrade
brew update
brew upgrade
brew install colima

Basically just out of date formula after an upgrade, though this shouldn’t have been possible.

What worked for me is rm -rf ~/.colima then colima start

After trying all the suggestions, rm -rf ~/.colima and colima start is what worked for me! Thanks sunspikes!

This just worked for me on my Mac M2, Sonoma 14.2.1.

colima delete
colima start --arch aarch64

hi, any progress with this one? still having this issue on an m3 macbook. colima start debug doesn’t work for me either.

@KManiKumarReddy you are most likely running x86_64 version of brew and utilising rosetta. You should ensure brew is running on native aarch64.

Likely related to https://github.com/abiosoft/colima/issues/204#issuecomment-1083220386.

thanks @abiosoft I did that and now I don’t have the qemu binary in the path: > msg="[hostagent] exec: \"qemu-system-x86_64\": executable file not found in $PATH" fields.level=fatal. but qemu shows up in brew list. Hmm, I wonder if I have a problem with brew

yeah, re-install it with brew install qemu