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

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.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

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:

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.