lima: ⚠️ QEMU (homebrew) was broken on Intel: `[hostagent] Driver stopped due to error: "signal: abort trap"` (or `"exit status 255"`) ... `QEMU has already exited`
Note
Colima users may still see
QEMU binary /Users/<USER>/.colima/_wrapper/<HASH>/bin/qemu-system-x86_64 is not properly signedwith the latest version of QEMU:The warning is negligible if the VM is actually working.
The warning should not be printed if you use Lima directly without Colima:
limactl start template://docker
Update (Aug 27, 2023): The issue is solved again in 8.1.0_1 (https://github.com/Homebrew/brew/pull/15903 , ~https://github.com/Homebrew/homebrew-core/pull/140596~ https://github.com/Homebrew/homebrew-core/pull/140643). Run brew reinstall -f --force-bottle qemu to install the updated v8.1.0 bottle.
Update (Aug 23, 2023): This seems to be broken again in v8.1.0 😞 (https://github.com/Homebrew/homebrew-core/issues/140244) . See the Workarounds below.
Update (Aug 14, 2023): The issue is now solved in https://github.com/Homebrew/homebrew-core/pull/139492 .
Run brew reinstall -f --force-bottle qemu to install the updated v8.0.4 bottle.
Homebrew bottle of QEMU v8.0.4 (Intel) ~is~ was broken due to a signing issue: https://github.com/Homebrew/homebrew-core/pull/139409
$ limactl start
...
[hostagent] Driver stopped due to error: "signal: abort trap"
...
[hostagent] QEMU has already exited
...
$ qemu-system-x86_64 -accel hvf
qemu-system-x86_64: -accel hvf: Unknown Error
Abort trap: 6
$ codesign --verify /usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64
/usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64: invalid signature (code or signature have been modified)
In architecture: x86_64
(The error message can be also [hostagent] Driver stopped due to error: "exit status 255")
Workarounds
Option 1: Downgrade QEMU to v8.0.3
brew uninstall qemu
curl -OSL https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb
brew install ./qemu.rb
Option 2: Install QEMU from the source
brew uninstall qemu
brew install --build-from-source qemu
Option 3: Sign the QEMU binary locally
Lima v0.17.2 shows a prompt to suggest applying this 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-$(uname -m | sed -e s/arm64/aarch64/)
Thanks to @z0sen for reporting this in https://github.com/abiosoft/colima/issues/777
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 12
- Comments: 23 (12 by maintainers)
Commits related to this issue
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module through `pip` ... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Flux and Mac OS CI steps (#209) The Flux CI step often fails because the `attrs` module cannot be found on the system. This commit fixes this behaviour by explicitly installing the module throu... — committed to alpha-unito/streamflow by GlassOfWhiskey 10 months ago
- Fix Mac OS CI steps As per issue lima-vm/lima#1742, the QEMU 8.1.0 Homebrew package is broken on Intel architectures. This commit upgrades the `douglascamata/setup-docker-macos-action` to version `v1... — committed to alpha-unito/streamflow-postgresql by GlassOfWhiskey 10 months ago
- Fix Mac OS CI steps (#26) As per issue lima-vm/lima#1742, the QEMU 8.1.0 Homebrew package is broken on Intel architectures. This commit upgrades the `douglascamata/setup-docker-macos-action` to ver... — committed to alpha-unito/streamflow-postgresql by GlassOfWhiskey 10 months ago
The issue is solved again in
8.1.0_1(https://github.com/Homebrew/brew/pull/15903 , ~https://github.com/Homebrew/homebrew-core/pull/140596~ https://github.com/Homebrew/homebrew-core/pull/140643).Run
brew reinstall -f --force-bottle qemuto install the updated v8.1.0 bottle.I was able to work around the issue by manually signing the wrapper link:
codesign --sign - --entitlements entitlements.xml --force /Users/eq/.colima/_wrapper/4e1b408f843d1c63afbbdcf80c40e4c88d33509f/bin/qemu-system-x86_64Along with these binaries (which are signed, now, after I trod a path of destruction through all plausible binaries and therefore cannot un-sign to test and see whether signing them is needed):
/usr/local/bin/qemu-system-x86_64/usr/local/Cellar/qemu/8.1.0_1/bin/qemu-system-x86_64From my slightly-cleaned-up-for-display error below, something seems to be checking whether the wrapper itself is signed. On my system, the wrapper is a link to
/usr/local/bin/colimawhich is signed. So I’m pretty confused bout this check but things are working.It doesn’t seem to be fixed for me. When starting colima it is still saying:
Since I have this issue I can also no longer build containers.
Here below the complete log
@janvda Using Lima without Colima may work as a workaround:
limactl start template://dockerRemoving
~/.colima/_wrappermay work too.Still seeing this when I run
colima startafter runningbrew reinstall -f --force-bottle qemu:Not sure if this is a lima or a colima problem. The VM does seem to start fine in spite of the warning.