abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.4k stars 390 forks source link

Colima doesn't start after OS update, fails with Waiting for the essential requirement 1 of 5: "ssh" #629

Open staliyan opened 1 year ago

staliyan commented 1 year ago

Description

After upgrading my mac to Ventura, colima start fails with below error.

`INFO[0000] starting colima INFO[0000] runtime: docker INFO[0000] preparing network ... context=vm INFO[0000] starting ... context=vm

[hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" did not receive an event with the "running" status FATA[0600] error starting vm: error at 'starting': exit status 1`

`colima list

PROFILE STATUS ARCH CPUS MEMORY DISK RUNTIME ADDRESS

default Running x86_64 2 4GiB 60GiB

delete Stopped x86_64 8 22GiB 60GiB

list Stopped x86_64 8 22GiB 60GiB`

Below is the error in stderr.log

{"level":"debug","msg":"Creating iso file /Users/test/.lima/colima/cidata.iso","time":"2023-02-21T16:48:52+01:00"} {"level":"debug","msg":"Using /var/folders/wt/f_t9xy6s0f173r1qyfw27m_c0000gr/T/diskfs_iso1691064567 as workspace","time":"2023-02-21T16:48:52+01:00"} {"level":"debug","msg":"OpenSSH version 9.0.1 detected","time":"2023-02-21T16:48:52+01:00"} {"level":"debug","msg":"AES accelerator seems available, prioritizing openssh.com","time":"2023-02-21T16:48:52+01:00"} {"level":"debug","msg":"firmware candidates = [/Users/test/.local/share/qemu/edk2-x86_64-code.fd /Users/test/.colima/_wrapper/***/share/qemu/edk2-x86_64-code.fd /usr/share/OVMF/OVMF_CODE.fd /usr/share/qemu/ovmf-x86_64-code.bin /usr/share/edk2-ovmf/x64/OVMF_CODE.fd]","time":"2023-02-21T16:48:53+01:00"} {"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/test/.lima/colima/serial.log\")","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"qCmd.Args: [/Users/test/.colima/_wrapper/***/bin/qemu-system-x86_64 -m 4096 -cpu qemu64 -machine q35,vmport=off -accel tcg,thread=multi,tb-size=512 -global ICH9-LPC.disable_s3=1 -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/test/.colima/_wrapper/***/edk2-x86_64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/test/.lima/colima/basedisk,media=cdrom,readonly=on -drive file=/Users/test/.lima/colima/diffdisk,if=virtio,discard=on -cdrom /Users/test/.lima/colima/cidata.iso -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:51407-:22 -device virtio-net-pci,netdev=net0,mac=*** -device virtio-rng-pci -display none -device virtio-vga -device virtio-keyboard-pci -device virtio-mouse-pci -device qemu-xhci,id=usb-bus -parallel none -chardev socket,id=char-serial,path=/Users/test/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/test/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/test/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/test/.lima/colima/qemu.pid]","time":"2023-02-21T16:48:53+01:00"} {"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"executing script \"ssh\"","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/test/.lima/_config/user\" -o IdentityFile=\"/Users/test/.ssh/id_rsa\" -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=\"***" -o User=test -o ControlMaster=auto -o ControlPath=\"/Users/test/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 51407 127.0.0.1 -- /bin/bash]","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 51407: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 51407: Connection refused\\r\\n\": exit status 255","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: -accel tcg,thread=multi,tb-size=512: warning: Guest expects a stronger memory ordering than the host provides","time":"2023-02-21T16:48:53+01:00"} {"level":"debug","msg":"qemu[stderr]: This may cause strange/hard to debug errors","time":"2023-02-21T16:48:53+01:00"} {"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-02-21T16:49:03+01:00"} {"level":"debug","msg":"executing script \"ssh\"","time":"2023-02-21T16:49:03+01:00"} {"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/test/.lima/_config/user\" -o IdentityFile=\"/Users/test/.ssh/id_rsa\" -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=staliyan001 -o ControlMaster=auto -o ControlPath=\"/Users/test/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 51407 127.0.0.1 -- /bin/bash]","time":"2023-02-21T16:49:03+01:00"} {"level":"debug","msg":"stdout=\"\", stderr=\"kex_exchange_identification: read: Connection reset by peer\\r\\nConnection reset by 127.0.0.1 port 51407\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"kex_exchange_identification: read: Connection reset by peer\\r\\nConnection reset by 127.0.0.1 port 51407\\r\\n\": exit status 255","time":"2023-02-21T16:50:17+01:00"} {"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-02-21T16:50:27+01:00"} {"level":"debug","msg":"executing script \"ssh\"","time":"2023-02-21T16:50:27+01:00"} {"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/test/.lima/_config/user\" -o IdentityFile=\"/Users/test/.ssh/id_rsa\" -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=\"***" -o User=test -o ControlMaster=auto -o ControlPath=\"/Users/test/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 51407 127.0.0.1 -- /bin/bash]","time":"2023-02-21T16:50:27+01:00"}

Version

Colima Version:0.5.2 Lima Version:0.14.2 Qemu Version:7.2.0

Operating System

Output of colima status

colima status FATA[0074] error retrieving current runtime: empty value

Reproduction Steps

1.colima start --cpu 8 --memory 22 --arch amd 2. 3.

Expected behaviour

Colima should start without errors and colima status should not throw any errors

Additional context

I tried reinstalling colima with --HEAD, still the same error. Also it starts with command colima start --arch aarch64, but obviously i get below error while starting my container. The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

kiczelkoo commented 1 year ago

I experience the same issue.

Here are logs from starting colima:

[   21.743057] Installing packages to root filesystem...
 * Installing packages to root filesystem: WARNING: Ignoring /media/sr0/apks: BAD signature
OK: 0 MiB in 0 packages
[   21.840294] Installing packages to root filesystem: ok.
ok.
grep: /sysroot/etc/inittab: No such file or directory
/sbin/init not found in new root. Launching emergency recovery shell
Type exit to continue boot.
sh: can't access tty; job control turned off
/ # ^[[12;5R^C

I start colima with command: colima start --cpu 4 --memory 8 --arch x86_64 --cpu-type max

It works without --cpu-type max

Jdban commented 1 year ago

Same here. Same logs. Same versions.

Version Colima Version:0.5.2 Lima Version:0.14.2 Qemu Version:7.2.0

Operating System

Also works without --cpu-type max for me, but I need that flag or my code starts segfaulting...

Jdban commented 1 year ago

Also without --cpu-type max my docker jobs likely freeze and hang indefinitely :/

Does anyone know how to solve this?

Jdban commented 1 year ago

@staliyan or @kiczelkoo, have either of you figured out a workaround?

Jdban commented 1 year ago

Updating to macOS 13.2.1 did not help. (I didn't really expect it to, but worth a shot)

abiosoft commented 1 year ago

Also without --cpu-type max my docker jobs likely freeze and hang indefinitely :/

Does anyone know how to solve this?

Can you share one of the docker images you are running that requires --cpu-type max ? You shouldn't need to specify the cpu type.

staliyan commented 1 year ago

@kiczelkoo I didn't find any solution/ workaround, not using colima for now. I read a suggestion to downgrade colima to some previous version. Couldn't find a command to do it. Other than this I really have no idea what else I should try.

Jdban commented 1 year ago

This is one of the issues describing the cpu-type of max being a fix for odd issues: https://github.com/docker/for-mac/issues/5561

Can you share one of the docker images you are running that requires --cpu-type max ? You shouldn't need to specify the cpu type.

My colima was set up this time with colima start --arch x86_64

Here's an image that can replicate it (run on my M1 mac):

docker run \
   --rm \
   -p 8080:8080 \
   --platform linux/amd64 \
   --env ENVIRONMENT=LOCAL \
   jdban/colima-test:latest

It won't fail every time, but when it does, it'll either fail pretty quickly, or spit out some logs first and then fail. Sometimes it'll work without a problem though.

Here's an example where it gave me literally no logs:

$ docker run \
   --rm \
   -p 8080:8080 \
   --platform linux/amd64 \
   --env ENVIRONMENT=LOCAL \
   jdban/colima-test:latest
^C^C^C^C^C^C^C^C^C^C^C

Ctrl + C did nothing. I had to kill it with docker kill, there was no other option.

When I was on previous version of mac osx using colima, it worked fine when I had the cpu-type set to max, but without that it was unreliable.

ultimike commented 1 year ago

I have a student experiencing this same issue. They are using:

Colima 0.5.4 Lima 0.15.0 Docker 23.0.1 Mac OS X Ventura 13.2.1

-mike

abiosoft commented 1 year ago

@ultimike have they tried stopping with the --force flag? Are they emulating x86 on m1 device?

colima stop --force
ultimike commented 1 year ago

@abiosoft I'm not sure exactly what you mean.

When they try to run colima start, it never finishes (it just keeps repeating Waiting for the essential requirement 1 of 5: "ssh), so at that point they can Crtl-c out of it.

Are you saying that after they Crtl-c out of that, they should colima stop --force and then try restarting Colima?

-mike

abiosoft commented 1 year ago

They should colima stop --force and then try restarting Colima?

@ultimike yeah.

Are they emulating x86_64 on an m1 device?

ultimike commented 1 year ago

Not sure - how would I be able to tell?

rfay commented 1 year ago

Use arch to find out the machine's architecture. Use file $(which colima) to find out what kind of architecture Colima is built for. If they have colima in /usr/local/bin, it's likely an old homebrew version, which needs to be removed and reinstalled if it's an Apple Silicon machine. Everything should be in /opt/homebrew/bin.

But if you're using DDEV with the right colima, there is no emulation of any kind happening.

adsr commented 1 year ago

Hi @abiosoft I'm also affected by this.

I'm attempting to emulate a rockylinux:9.1-minimal container on x86_64 on an M1 laptop (aarch64). The container starts but fails on the first executable with:

Fatal glibc error: CPU does not support x86-64-v2

I didn't dig into the details but some searching indicates --cpu-type=max fixes the issue. My full colima invocation is:

colima start --arch x86_64 --cpu-type max

As others have shared in this thread, tailing serial.log, the last few lines indicate 0 packages were installed due to apk throwing BAD signature followed by /sbin/init not found in new root. It then jumps into a root shell, and colima hangs forever waiting for ssh. If there are any logs or extra details I can share, let me know.

EDIT: The "x86-64-v2" error above is reproducible with the following command: docker run -it rockylinux:9.1-minimal /bin/bash

staliyan commented 1 year ago

--cpu-type=max didn't work for me.

`░▒▓ arch arm64

░▒▓ file $(which colima) /opt/homebrew/bin/colima: Mach-O 64-bit executable arm64

░▒▓ colima start --arch x86_64 --cpu-type max INFO[0000] starting colima INFO[0000] runtime: docker INFO[0000] preparing network ... context=vm INFO[0000] starting ... context=vm

[hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" did not receive an event with the "running" status FATA[0600] error starting vm: error at 'starting': exit status 1`

abiosoft commented 1 year ago

Have you tried using --cpu-type qemu64.

yb66 commented 1 year ago

I have a (by the looks of it) similar problem with Colima, in that it won't connect via ssh. I've tried everything in this thread. The serial.log shows me "* Starting sshd ... [ ok ]" but the connection doesn't happen. What I have noticed is that ~/.colima/ssh_config is always empty.

Any ideas what I should write in there to test it?

obfischer commented 1 year ago

--cpu-type=max didn't work for me.

`░▒▓ arch arm64

░▒▓ file $(which colima) /opt/homebrew/bin/colima: Mach-O 64-bit executable arm64

░▒▓ colima start --arch x86_64 --cpu-type max INFO[0000] starting colima INFO[0000] runtime: docker INFO[0000] preparing network ... context=vm INFO[0000] starting ... context=vm

[hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" [hostagent] Waiting for the essential requirement 1 of 5: "ssh" did not receive an event with the "running" status FATA[0600] error starting vm: error at 'starting': exit status 1`

Could you please attach the output of the serial.log? I have the same symptoms and it seem so, that the underlaying qemu is not able to start properly.

abiosoft commented 1 year ago

I have a (by the looks of it) similar problem with Colima, in that it won't connect via ssh. I've tried everything in this thread. The serial.log shows me "* Starting sshd ... [ ok ]" but the connection doesn't happen. What I have noticed is that ~/.colima/ssh_config is always empty.

Any ideas what I should write in there to test it?

@yb66 are you emulating x64_64 on m1 or using --vm-type vz?

yb66 commented 1 year ago

@abiosoft Neither, sorry to be so unhelpful. I took a quick look at the ssh generation code but I can't be entirely sure what it would generate. It seems to me that I should try connecting manually first and then work out why a config isn't generated, but I've no idea how Colima/Docker handles networking so I've no idea what the ssh incantation should be. Hence why I'd be interested to know what the config might usually hold.

abiosoft commented 1 year ago

@yb66 actually ~/.colima/ssh_config is only non-empty when an instance is running. It is expected to be empty.

Does testing with another profile work?

# create an instance named `test`
colima start test
tomwaits commented 1 year ago

I've also had the issue and found that it doesn't happen if you delete any prior 'profile' in the ~/.lima folder. It should only contain the _config file, nothing else, and everything works smoothly. Here are the steps I followed: A. clearing the 'profile' folders in ~/.lima

  1. rm -rf ~/.colima (if folder exists)
  2. cd ~/.lima
  3. mv _config ../
  4. rm -rf *
  5. mv ../_config . B. Starting a fresh instance
  6. colima start --cpu 4 --memory 8 ( no need for the arch options )
  7. colima status (to check that it all works)

A new folder ~/.colima is created with configs and .sock.

Hope this help.

yb66 commented 1 year ago

@yb66 actually ~/.colima/ssh_config is only non-empty when an instance is running. It is expected to be empty.

The instance is running, I can see that from the serial.log, but the config is always empty, whether running or not.

Does testing with another profile work?

    $ colima start test
    INFO[0000] starting colima [profile=test]
    INFO[0000] runtime: docker
    INFO[0000] preparing network ...                         context=vm
    INFO[0000] creating and starting ...                     context=vm
    > [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
    > [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
    > [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
    > [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
    > [hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh"
    > did not receive an event with the "running" status
    FATA[0602] error starting vm: error at 'creating and starting': exit status 1

    $ tail -f ~/.lima/colima/serial.log
     *   Unmounting /root ... [ ok ]
     *   Unmounting /home ... [ ok ]
     *   Unmounting /etc ... [ ok ]
     *   Unmounting /mnt/data ... [ ok ]
     *   Unmounting /mnt/lima-cidata ... [ ok ]
     *   Unmounting /media/sr0 ... [ ok ]
     * Setting hardware clock using the system clock [UTC] ... [ ok ]
     * Stopping udev ... [ ok ]
     [ ok ]
     * Terminating remaining processes ...[ 2504.385611] reboot: Power down

If I just start normally, then I get the following from serial.log:

    udhcpc: lease of 192.168.5.15 obtained from 192.168.5.2, lease time 86400
     [ ok ]
     [ ok ]
     * Registering QEMU binaries in binfmt misc ... [ ok ]
     * Starting sshd ... [ ok ]

    Welcome to Alpine Linux 3.16
    Kernel 5.15.82-0-virt on an x86_64 (/dev/ttyS0)

    colima login:

And that's where it stops, waiting. I've tried removing colima and reinstalling it (which also upgraded it from 0.5.2 to 0.5.4), running colima start debug and several of the other switches given in this thread.

vsjoshtait commented 1 year ago

I regularly experience the same issue on an M1 Mac (ARM arch.) with no emulation. Occassionally, deleting the colima profile colima delete default and then colima start is sometimes enough to get the SSH part to work. Typically though, I've found that removing ~/.lima and ~/.colima and then colima start again works but this might be a fluke. It's a bit disappointing that I need to rebuild all my docker containers regularly. This problem also seems to happen every time I reboot my machine so might leave it running for a few days ;).

Hopefully this helps someone in the meantime.

Edit: just to ask, do I need QEMU if I'm running m1 based images on colima? Curious to learn a bit more about how Colima works.

abiosoft commented 1 year ago

@vsjoshtait yeah you do need QEMU except you are using virtualization framework i.e. colima start --vm-type vz.

chaosi-zju commented 1 year ago

try colima start --vm-type qemu

ventz commented 1 year ago

Same issue on a M3 (stuck in SSH)

Deleting profiles/etc did nothing.

What worked eventually is doing colima start --vm-type vz

dampfhamm3r commented 1 year ago

Same issue on a M3 (stuck in SSH)

Deleting profiles/etc did nothing.

What worked eventually is doing colima start --vm-type vz

For me it worked only once after: mv .colima/ .colima_old mv .lima .lima_old

❯ colima status
INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/username.colima/default/docker.sock

This is on M3 Pro, Sonoma 14.1.1 with: ==> qemu: stable 8.1.2 (bottled), HEAD ==> lima: stable 0.18.0 (bottled), HEAD ==> colima: stable 0.5.6 (bottled), HEAD

a colima stop and colima start resulted then in the issue mentioned (stuck in SSH)

ventz commented 12 months ago

Saw the new version pushed out to brew -- that seems to have fixed it:

% colima --version
colima version 0.6.0

edit: @abiosoft saw the release notes and change - thank you for the quick fix!!

tdy commented 12 months ago

Saw the new version pushed out to brew -- that seems to have fixed it:

Still broken on my end:

$ colima --version
colima version v0.6.0

$ colima delete
are you sure you want to delete colima and all settings? [y/N] y
INFO[0000] deleting colima
WARN[0003] error retrieving runtimes: error retrieving current runtime: empty value
INFO[0004] done

$ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] creating and starting ...                     context=vm
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> did not receive an event with the "running" status
FATA[0600] error starting vm: error at 'creating and starting': exit status 1
ventz commented 12 months ago

@tdy After the stop+delete, try also: rm -Rf ~/.colima ~/.lima folders, and then try starting again.

tdy commented 12 months ago

@tdy After the stop+delete, try also: rm -Rf ~/.colima ~/.lima folders, and then try starting again.

Same result:

$ colima --version
colima version v0.6.0

$ colima stop
INFO[0000] stopping colima
INFO[0000] not running                                   context=vm
INFO[0000] done

$ colima delete
are you sure you want to delete colima and all settings? [y/N] y
INFO[0000] deleting colima
INFO[0000] done

$ rm -rf ~/.colima ~/.lima

$ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] creating and starting ...                     context=vm
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] QEMU did not exit in 3m0s, forcibly killing QEMU
> [hostagent] QEMU has exited, after killing forcibly
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/tim/.colima/_lima/colima/ha.stderr.log")
FATA[0301] error starting vm: error at 'creating and starting': exit status 1
abiosoft commented 12 months ago

@tdy your issue seems to be something else, likely related to QEMU.

Can you try using the vz driver?

colima start --vm-type vz
tdy commented 12 months ago

@tdy your issue seems to be something else, likely related to QEMU.

Ah yes, I didn't notice the 2nd one ended with a different QEMU message.

Can you try using the vz driver?

colima start --vm-type vz

Thanks, this worked.

ventz commented 11 months ago

@abiosoft It seems it started happening again:

(edit: on 0.6.3 and 0.6.5)

% colima start
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0001] creating and starting ...                     context=vm
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"

Upgraded to 0.6.5, same thing:

% colima --version
colima version 0.6.5

Using VZ now is doing the same unfortunately:

% colima start --vm-type vz
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0001] creating and starting ...                     context=vm
> [hostagent] Starting VZ (hint: to watch the boot progress, see "/Users/user/.colima/_lima/colima/serial*.log")
> SSH Local Port: 52369
> [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
> [hostagent] [VZ] - vm state change: running
> [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
ventz commented 11 months ago

Manually downgraded to 0.6.0 and started with colima start --vm-type vz for the time being.

For anyone in the same boat, unlink colima brew unlink colima, and edit the fomula manually:

cd /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/c

Edit colima.rb to:

...
tag:      "v0.6.0",
revision: "088283a24237ccd6ef4f27f3e3040b48bd147a23"
...

And build new:

brew install --build-from-source ./colima.rb

Verify version:

% colima --version         
colima version 0.6.0

And finally start:

colima delete
cd ~
rm -Rf .colima .lima
colima start --vm-type vz
kimberlyamandalu commented 11 months ago

I had several issues setting up Colima.

Colima Version: 0.6.6 Docker Version: 24.0.7 OS: Mac M3 running Sonoma 14.1.1

Issue 1

Cannot run docker cli commands due to not being able to connect to Docker daemon. Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Attempted Fix Which did NOT Work: Set environment variable DOCKER_HOST: export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"

Issue 2

Starting colima is stuck in Waiting for the essential requirement 1 of 4: "ssh" Error:

$ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0001] creating and starting ...                     context=vm
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "~/.colima/_lima/colima/serial*.log")
> SSH Local Port: 53987
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"

The Fix

What eventually worked for me is:

  1. Delete default colima profile: colima delete default
  2. Delete ~/.colima: rm -rf ~/.colima
  3. Start colima with vm-type parameter: colima start --vm-type vz
  4. Colima status
    $ colima status
        INFO[0000] colima is running using macOS Virtualization.Framework
        INFO[0000] arch: aarch64
        INFO[0000] runtime: docker
        INFO[0000] mountType: virtiofs
        INFO[0000] socket: unix://$HOME/.colima/default/docker.sock

P.S.

I installed docker, docker-compose, docker-buildx using Homebrew BEFORE installing colima

avoidik commented 11 months ago

if you'd try to run amazon-linux-2023 docker image on arm64 macos you'll get the error similar to this

$ docker run -i -t --rm --name al2023 --security-opt seccomp=unconfined public.ecr.aws/amazonlinux/amazonlinux:2023 /bin/bash
Unable to find image 'public.ecr.aws/amazonlinux/amazonlinux:2023' locally
2023: Pulling from amazonlinux/amazonlinux
bad342ce986c: Pull complete
Digest: sha256:6235e87e753667a84f0adb06e65ee19950d8335f4bf279932fe4f01aa4a4b3cf
Status: Downloaded newer image for public.ecr.aws/amazonlinux/amazonlinux:2023
Fatal glibc error: CPU does not support x86-64-v2

the only thing that helped me was this

$ export QEMU_SYSTEM_X86_64="qemu-system-x86_64 -cpu Haswell-v4"
$ colima start colima-intel --cpu 2 --memory 4 --disk 20 --arch x86_64 --vm-type=vz --vz-rosetta
ItsCosmas commented 11 months ago

Facing a similar Issue on M1 and Sonoma:

Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.", err: "exit status 1

On Version 0.6.7 -> colima version 0.6.7

~ % colima start       
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] starting ...                                  context=vm
INFO[0011] provisioning ...                              context=docker
INFO[0011] starting ...                                  context=docker
FATA[0179] error starting docker: error running [lima sudo service docker start], output: "Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.", err: "exit status 1" 

And when I attempt vm type options I get:

~ % colima start --vm-type vz
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] starting ...                                  context=vm
> Using the existing instance "colima"
> Starting the instance "colima" with VM driver "vz"
> [hostagent] hostagent socket created at /Users/cozy/.colima/_lima/colima/ha.sock
> [hostagent] Starting VZ (hint: to watch the boot progress, see "/Users/cozy/.colima/_lima/colima/serial*.log")
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/cozy/.colima/_lima/colima/ha.stderr.log")
FATA[0000] error starting vm: error at 'starting': exit status 1 
avoidik commented 11 months ago

@ItsCosmas in your case this is a problem with a standard templates, try to clean up ~/.colima/_templates directory and start over

ItsCosmas commented 11 months ago

I had several issues setting up Colima.

Colima Version: 0.6.6 Docker Version: 24.0.7 OS: Mac M3 running Sonoma 14.1.1

Issue 1

Cannot run docker cli commands due to not being able to connect to Docker daemon. Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Attempted Fix Which did NOT Work: Set environment variable DOCKER_HOST: export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"

Issue 2

Starting colima is stuck in Waiting for the essential requirement 1 of 4: "ssh" Error:

$ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0001] creating and starting ...                     context=vm
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "~/.colima/_lima/colima/serial*.log")
> SSH Local Port: 53987
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"

The Fix

What eventually worked for me is:

  1. Delete default colima profile: colima delete default
  2. Delete ~/.colima: rm -rf ~/.colima
  3. Start colima with vm-type parameter: colima start --vm-type vz
  4. Colima status
    $ colima status
       INFO[0000] colima is running using macOS Virtualization.Framework
       INFO[0000] arch: aarch64
       INFO[0000] runtime: docker
       INFO[0000] mountType: virtiofs
       INFO[0000] socket: unix://$HOME/.colima/default/docker.sock

P.S.

I installed docker, docker-compose, docker-buildx using Homebrew BEFORE installing colima

This works for me:

Delete default colima profile: colima delete default Delete ~/.colima: rm -rf ~/.colima Start colima with vm-type parameter: colima start --vm-type vz

ItsCosmas commented 11 months ago

@ItsCosmas in your case this is a problem with a standard templates, try to clean up ~/.colima/_templates directory and start over

Have cleaned up the ~/.colima and everything is okay now

miguelvr commented 9 months ago

using --vm-type=vz works, but not ideal

re-installing qemu fixed it for me:

brew reinstall -f --force-bottle qemu
shagunpaul commented 7 months ago

@miguelvr

reinstalling qemu did not work for me. I am able to start colima using --vm-type=vz but getting authorization issues while running my service.

how do i run colima without using --vm-type=vz , also why is it not ideal to use this flag

SmartManoj commented 4 months ago

re-installing qemu fixed it for me:

What changes will happen during this?

bruceeelin commented 3 months ago

@ultimike have they tried stopping with the --force flag? Are they emulating x86 on m1 device?

colima stop --force

budy, Great, it worked for me~