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

colima start error: failed to open the QMP socket $HOME/.lima/colima/qmp.sock", forcibly killing QEMU #746

Closed
1 of 5 tasks
acechuafp opened this issue Jun 28, 2023 · 23 comments

Comments

@acechuafp
Copy link

acechuafp commented Jun 28, 2023

Description

Steps to Reproduce

Run colima start

Actual

Process is killed with error: failed to open the QMP socket "$HOME/.lima/colima/qmp.sock", forcibly killing QEMU.
ha.stderr.log

Expected

colima starts without errors.

Version

Colima Version: v0.5.5
Lima Version: 0.16.0
Qemu Version: 7.1.0

Operating System

  • macOS Intel <= 12 (Monterrey)
  • macOS Intel >= 13 (Ventura)
  • macOS M1 <= 12 (Monterrey)
  • macOS M1 >= 13 (Ventura)
  • Linux

Output of colima status

colima is not running

Reproduction Steps

  1. Run colima start
  2. Process is killed with error: failed to open the QMP socket "$HOME/.lima/colima/qmp.sock", forcibly killing QEMU.

Expected behaviour

colima starts without errors.

Additional context

I have tried to reinstall homebrew but it still did not help.

@acechuafp acechuafp changed the title colima start error: failed to open the QMP socket "/Users/a.chua.4/.lima/colima/qmp.sock", forcibly killing QEMU colima start error: failed to open the QMP socket $HOME/.lima/colima/qmp.sock", forcibly killing QEMU Jul 28, 2023
@erikkrieg
Copy link

I'm also seeing this on macOS Intel >= 13

@abiosoft
Copy link
Owner

Can you upgrade Qemu to 8.0.0?

@erikkrieg
Copy link

erikkrieg commented Jul 28, 2023

I've tried qemu 8.0.0 and that didn't work for me, but I just tried upgrading from 0.5.4 to 0.5.5 and that did work for me. So my problem appears to have been different from OPs. I think the SSH fix is what I needed.

Edit: I just want to confirm that my issue was indeed fixed by upgrading to 0.5.5

@acechuafp
Copy link
Author

sflr and thank you for the suggestions. I have tried upgrading Qemu to 8.0.3 and I am still seeing the same error. Here is the error log

{"level":"debug","msg":"Creating iso file /Users/a.chua.4/.lima/colima/cidata.iso","time":"2023-08-08T10:42:08+08:00"}
{"level":"debug","msg":"Using /var/folders/1s/x1w4tg0s40sbj9zd_0prqrk9dh2qt8/T/diskfs_iso3099075462 as workspace","time":"2023-08-08T10:42:08+08:00"}
{"level":"debug","msg":"OpenSSH version 9.0.1 detected","time":"2023-08-08T10:42:08+08:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2023-08-08T10:42:08+08:00"}
{"level":"debug","msg":"QEMU version 7.1.0 detected","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"firmware candidates = [/Users/a.chua.4/.local/share/qemu/edk2-x86_64-code.fd /Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/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-08-08T10:42:09+08:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/a.chua.4/.lima/colima/serial.log\")","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/bin/qemu-system-x86_64 -m 12288 -cpu host,-pdpe1gb -machine q35,accel=hvf -smp 4,sockets=1,cores=4,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/share/qemu/edk2-x86_64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/a.chua.4/.lima/colima/basedisk,format=raw,media=cdrom,readonly=on -drive file=/Users/a.chua.4/.lima/colima/diffdisk,if=virtio,discard=on -drive id=cdrom0,if=none,format=raw,readonly=on,file=/Users/a.chua.4/.lima/colima/cidata.iso -device virtio-scsi-pci,id=scsi0 -device scsi-cd,bus=scsi0.0,drive=cdrom0 -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:54009-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:af:2c:5e -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/a.chua.4/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/a.chua.4/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/a.chua.4/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/a.chua.4/.lima/colima/qemu.pid]","time":"2023-08-08T10:42:09+08:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/a.chua.4/.lima/_config/user\" -o IdentityFile=\"/Users/a.chua.4/.ssh/id_ed25519\" -o IdentityFile=\"/Users/a.chua.4/.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=lima -o ControlMaster=auto -o ControlPath=\"/Users/a.chua.4/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 54009 127.0.0.1 -- /bin/bash]","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: -netdev stream,id=vlan,addr.type=unix,addr.path=/Users/a.chua.4/.colima/default/daemon/gvproxy.sock: Parameter 'type' does not accept value 'stream'","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 54009: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 54009: Connection refused\\r\\n\": exit status 255","time":"2023-08-08T10:42:09+08:00"}
{"level":"info","msg":"Driver stopped due to error: \"exit status 1\"","time":"2023-08-08T10:42:09+08:00"}
{"level":"info","msg":"Shutting down the host agent","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"shutting down the SSH master","time":"2023-08-08T10:42:09+08:00"}
{"level":"debug","msg":"executing ssh for exiting the master: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/a.chua.4/.lima/_config/user\" -o IdentityFile=\"/Users/a.chua.4/.ssh/id_ed25519\" -o IdentityFile=\"/Users/a.chua.4/.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=lima -o ControlMaster=auto -o ControlPath=\"/Users/a.chua.4/.lima/colima/ssh.sock\" -o ControlPersist=5m -O exit -p 54009 127.0.0.1]","time":"2023-08-08T10:42:09+08:00"}
{"error":"failed to execute `ssh -O exit -p 54009 127.0.0.1`, out=\"Control socket connect(/Users/a.chua.4/.lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255","level":"warning","msg":"failed to exit SSH master","time":"2023-08-08T10:42:09+08:00"}
{"level":"info","msg":"Shutting down QEMU with ACPI","time":"2023-08-08T10:42:09+08:00"}
{"error":"dial unix /Users/a.chua.4/.lima/colima/qmp.sock: connect: connection refused","level":"warning","msg":"failed to open the QMP socket \"/Users/a.chua.4/.lima/colima/qmp.sock\", forcibly killing QEMU","time":"2023-08-08T10:42:09+08:00"}
{"level":"info","msg":"QEMU has already exited","time":"2023-08-08T10:42:09+08:00"}

@fxzou
Copy link

fxzou commented Aug 13, 2023

I'm also seeing this on macOS 12 Intel

@robhung
Copy link

robhung commented Aug 14, 2023

My error log:

{"level":"debug","msg":"Creating iso file /Users/Robert/.lima/colima/cidata.iso","time":"2023-08-14T12:55:17+10:00"}
{"level":"debug","msg":"Using /var/folders/54/92z_vmk121vd6gk740rn484r0000gn/T/diskfs_iso421121710 as workspace","time":"2023-08-14T12:55:17+10:00"}
{"level":"debug","msg":"OpenSSH version 9.0.1 detected","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"QEMU version 8.0.4 detected","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"firmware candidates = [/Users/Robert/.local/share/qemu/edk2-x86_64-code.fd /Users/Robert/.colima/_wrapper/4e1b408f843d1c63afbbdcf80c40e4c88d33509f/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-08-14T12:55:18+10:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/Robert/.lima/colima/serial*.log\")","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/Robert/.colima/_wrapper/4e1b408f843d1c63afbbdcf80c40e4c88d33509f/bin/qemu-system-x86_64 -m 4096 -cpu host,-pdpe1gb -machine q35,accel=hvf -smp 4,sockets=1,cores=4,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/Robert/.colima/_wrapper/4e1b408f843d1c63afbbdcf80c40e4c88d33509f/share/qemu/edk2-x86_64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/Robert/.lima/colima/basedisk,format=raw,media=cdrom,readonly=on -drive file=/Users/Robert/.lima/colima/diffdisk,if=virtio,discard=on -drive id=cdrom0,if=none,format=raw,readonly=on,file=/Users/Robert/.lima/colima/cidata.iso -device virtio-scsi-pci,id=scsi0 -device scsi-cd,bus=scsi0.0,drive=cdrom0 -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:51754-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:96:9f:8b -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/Robert/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/Robert/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-serial-virtio,path=/Users/Robert/.lima/colima/serialv.sock,server=on,wait=off,logfile=/Users/Robert/.lima/colima/serialv.log -device virtio-serial-pci,id=virtio-serial0,max_ports=1 -device virtconsole,chardev=char-serial-virtio,id=console0 -chardev socket,id=char-qmp,path=/Users/Robert/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/Robert/.lima/colima/qemu.pid]","time":"2023-08-14T12:55:18+10:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/Robert/.lima/_config/user\" -o IdentityFile=\"/Users/Robert/.ssh/id_ed25519\" -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=lima -o ControlMaster=auto -o ControlPath=\"/Users/Robert/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 51754 127.0.0.1 -- /bin/bash]","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: Unknown Error","time":"2023-08-14T12:55:18+10:00"}
{"level":"info","msg":"Driver stopped due to error: \"exit status 255\"","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 51754: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 51754: Connection refused\\r\\n\": exit status 255","time":"2023-08-14T12:55:18+10:00"}
{"level":"info","msg":"Shutting down the host agent","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"shutting down the SSH master","time":"2023-08-14T12:55:18+10:00"}
{"level":"debug","msg":"executing ssh for exiting the master: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/Robert/.lima/_config/user\" -o IdentityFile=\"/Users/Robert/.ssh/id_ed25519\" -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=lima -o ControlMaster=auto -o ControlPath=\"/Users/Robert/.lima/colima/ssh.sock\" -o ControlPersist=5m -O exit -p 51754 127.0.0.1]","time":"2023-08-14T12:55:18+10:00"}
{"error":"failed to execute `ssh -O exit -p 51754 127.0.0.1`, out=\"Control socket connect(/Users/Robert/.lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255","level":"warning","msg":"failed to exit SSH master","time":"2023-08-14T12:55:18+10:00"}
{"level":"info","msg":"Shutting down QEMU with ACPI","time":"2023-08-14T12:55:18+10:00"}
{"error":"dial unix /Users/Robert/.lima/colima/qmp.sock: connect: connection refused","level":"warning","msg":"failed to open the QMP socket \"/Users/Robert/.lima/colima/qmp.sock\", forcibly killing QEMU","time":"2023-08-14T12:55:18+10:00"}
{"level":"info","msg":"QEMU has already exited","time":"2023-08-14T12:55:18+10:00"}

Versions:

Robert@C02G75CbertHung platform % sw_vers
ProductName:		macOS
ProductVersion:		13.5
BuildVersion:		22G74

Robert@C02G75CbertHung platform % uname -a
Darwin C02G75CbertHung.localdomain 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64

Robert@C02G75CbertHung platform % colima version
colima version 0.5.5
git commit: 6251dc2c2c5d8197c356f0e402ad028945f0e830

Robert@C02G75CbertHung platform % lima --version
limactl version 0.17.1

Robert@C02G75CbertHung platform % qemu-img -V
qemu-img version 8.0.4
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

UPDATE:

  • Had another colleague on qemu@8.0.3 and he upgraded to qemu@8.0.4, and experienced the same issue as me.

@robhung
Copy link

robhung commented Aug 14, 2023

lima@0.17.2 seems to have identified root cause which explains why qemu@8.0.4 was broken

cc: lima-vm/lima#1742 #777

@AkihiroSuda
Copy link
Contributor

The issue is now solved:

@rfay
Copy link
Contributor

rfay commented Aug 14, 2023

Thanks so much for chasing this so successfully @AkihiroSuda !

@cheng-yang-myob
Copy link

Thanks guys. I ran into the same problem. Fortunately it has been resolved. After reinstall qemu brew reinstall -f --force-bottle qemu it works well now.

@acechuafp
Copy link
Author

thank you for the help and support. i tried updating qemu and it seems like the error does not go away. anything that i am missing out? thank you guys 🙏

{"level":"debug","msg":"Creating iso file /Users/a.chua.4/.lima/colima/cidata.iso","time":"2023-08-18T09:24:09+08:00"}
{"level":"debug","msg":"Using /var/folders/1s/x1w4tg0s40sbj9zd_0prqrk9dh2qt8/T/diskfs_iso3572815485 as workspace","time":"2023-08-18T09:24:09+08:00"}
{"level":"debug","msg":"OpenSSH version 9.0.1 detected","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"QEMU version 7.1.0 detected","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"firmware candidates = [/Users/a.chua.4/.local/share/qemu/edk2-x86_64-code.fd /Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/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-08-18T09:24:10+08:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/a.chua.4/.lima/colima/serial.log\")","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/bin/qemu-system-x86_64 -m 2048 -cpu host,-pdpe1gb -machine q35,accel=hvf -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/a.chua.4/.colima/_wrapper/deb1e70b41dbdb7e6adc33904dd8f6df01f3b72d/share/qemu/edk2-x86_64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/a.chua.4/.lima/colima/basedisk,format=raw,media=cdrom,readonly=on -drive file=/Users/a.chua.4/.lima/colima/diffdisk,if=virtio,discard=on -drive id=cdrom0,if=none,format=raw,readonly=on,file=/Users/a.chua.4/.lima/colima/cidata.iso -device virtio-scsi-pci,id=scsi0 -device scsi-cd,bus=scsi0.0,drive=cdrom0 -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:50847-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:af:2c:5e -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/a.chua.4/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/a.chua.4/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/a.chua.4/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/a.chua.4/.lima/colima/qemu.pid]","time":"2023-08-18T09:24:10+08:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/a.chua.4/.lima/_config/user\" -o IdentityFile=\"/Users/a.chua.4/.ssh/id_ed25519\" -o IdentityFile=\"/Users/a.chua.4/.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=lima -o ControlMaster=auto -o ControlPath=\"/Users/a.chua.4/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 50847 127.0.0.1 -- /bin/bash]","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: -netdev stream,id=vlan,addr.type=unix,addr.path=/Users/a.chua.4/.colima/default/daemon/gvproxy.sock: Parameter 'type' does not accept value 'stream'","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 50847: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 50847: Connection refused\\r\\n\": exit status 255","time":"2023-08-18T09:24:10+08:00"}
{"level":"info","msg":"Driver stopped due to error: \"exit status 1\"","time":"2023-08-18T09:24:10+08:00"}
{"level":"info","msg":"Shutting down the host agent","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"shutting down the SSH master","time":"2023-08-18T09:24:10+08:00"}
{"level":"debug","msg":"executing ssh for exiting the master: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/a.chua.4/.lima/_config/user\" -o IdentityFile=\"/Users/a.chua.4/.ssh/id_ed25519\" -o IdentityFile=\"/Users/a.chua.4/.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=lima -o ControlMaster=auto -o ControlPath=\"/Users/a.chua.4/.lima/colima/ssh.sock\" -o ControlPersist=5m -O exit -p 50847 127.0.0.1]","time":"2023-08-18T09:24:10+08:00"}
{"error":"failed to execute `ssh -O exit -p 50847 127.0.0.1`, out=\"Control socket connect(/Users/a.chua.4/.lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255","level":"warning","msg":"failed to exit SSH master","time":"2023-08-18T09:24:10+08:00"}
{"level":"info","msg":"Shutting down QEMU with ACPI","time":"2023-08-18T09:24:10+08:00"}
{"error":"dial unix /Users/a.chua.4/.lima/colima/qmp.sock: connect: connection refused","level":"warning","msg":"failed to open the QMP socket \"/Users/a.chua.4/.lima/colima/qmp.sock\", forcibly killing QEMU","time":"2023-08-18T09:24:10+08:00"}
{"level":"info","msg":"QEMU has already exited","time":"2023-08-18T09:24:10+08:00"}

@rfay
Copy link
Contributor

rfay commented Aug 18, 2023

I'm still struggling with this on Github Workflows :( I imagine the runner image hasn't been properly updated, or some runners are still in the wild with the bad version.

@AkihiroSuda
Copy link
Contributor

QEMU version 7.1.0 detected

Seems old

@verdverm
Copy link

It's not fixing it on GitHub Actions: https://github.com/hofstadter-io/hof/actions/runs/5898945057/job/16000752109

qemu-8.0.4

@AkihiroSuda
Copy link
Contributor

It's not fixing it on GitHub Actions: https://github.com/hofstadter-io/hof/actions/runs/5898945057/job/16000752109

qemu-8.0.4

  • Any error in ~/.lima/colima/ha.stderr.log ?
  • Is lima the latest version (v0.17.2) too?
  • Does the plain Lima work? (limactl start template://docker, or limactl start template://docker-rootful)

@mezbot-v1
Copy link

Hi 👋

TL;DR try resetting your default colima profile with:

colima delete
colima start

I've been lurking on this thread because I've had all the issues mentioned above and diligently went through all the troubleshooting steps mentioned here and linked from other issues raised (and closed) across lima and colima. I also tried downgrading my versions to colima 0.5.4 and qemu 8.0.3 but to no avail.

Anyways I think I found the fix? Funnily enough it was through the ol' RTFM and heading to this section in the FAQ of the Colima docs: https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#issues-after-an-upgrade

If you, like me, have done All The Things to try and get colima to recognise the validity of the apple hypervisor signature within the qemu binary, then the issue might be that your default colima profile might need to be reset.

Test this with:

# start with a profile named 'debug'
colima start debug

If the separate profile starts successfully without issues, then the issue would be resolved by resetting the default profile:

colima delete
colima start

After I did that, colima was good to go:

colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] creating and starting ...                     context=vm
INFO[0052] provisioning ...                              context=docker
INFO[0052] starting ...                                  context=docker
INFO[0058] done 

Version

Colima Version: 0.5.5
Lima Version: 0.17.2
Qemu Version: (aka qemu-system-x86_64 --version) 8.0.4

Operating System

macOS Intel
Ventura 13.5

Hope that helps someone -- if you want the verbose edition or the ha.stderr.log excerpts let me know

@verdverm
Copy link

After working through the issues, I got everything up to date on my GHA worker, still saw the same error

Eventually what worked for me was to run these steps rather than the crazy-max/ghaction-setup-docker@v1 and trying to adjust that with commands afterwards.

brew install docker
brew reinstall -f --force-bottle qemu lima colima 
colima start debug --cpu 3 --memory 10 --disk 12

deleting the profile only caused other problems, it was not pleasant to debug by pushing commits :], so I didn't dig deeper as to why

@verdverm
Copy link

take that back, still seeing issues

@verdverm
Copy link

actions/runner-images#8104

looks like we still have to wait for a rollout still

there are more workarounds there

@t3rn0
Copy link

t3rn0 commented Aug 25, 2023

Ran into this problem. Tried reinstalling colima, lima, qemu but that didn't help.
Finally decided to leave qemu and switched to vz and colima started:

$ colima start --vm-type vz

Versions

macOS Intel
Ventura 13.5
Colima 0.5.5
Lima 0.17.2
Qemu 8.1.0

@AkihiroSuda
Copy link
Contributor

Workaround

cat >entitlements.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.hypervisor</key>
    <true/>
</dict>
</plist>
EOF

codesign --sign - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64

The proper fix is proposed here:

@verdverm
Copy link

This is our working GHA workaround, thanks for the help y'all 🙏

brew install docker
brew reinstall -f --force-bottle qemu lima colima 

# hack to codesign for entitlement
cat >entitlements.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
		<key>com.apple.security.hypervisor</key>
		<true/>
</dict>
</plist>
EOF
codesign --sign - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64

colima start --cpu 3 --memory 10 --disk 12

and also

echo "DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"" >> $GITHUB_ENV

(because we have a tool that needs this)

@acechuafp
Copy link
Author

acechuafp commented Aug 29, 2023

sflr again. thank you all for the detailed inputs and valuable support. greatly appreciate it 😄 🙏 . finally got it to work yay 💯 !

it seems like i needed to run the command

colima start --arch x86_64

instead without seeing the

waiting for the essential requirement 1 of 5: "ssh"

log for too long.

but anyways its working so im gonna close this 👍

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