Skip to content

Instantly share code, notes, and snippets.

@chrissearle
Last active August 18, 2023 14:26
Show Gist options
  • Save chrissearle/b8434a11eaabd76bcf8a8e74dde21f61 to your computer and use it in GitHub Desktop.
Save chrissearle/b8434a11eaabd76bcf8a8e74dde21f61 to your computer and use it in GitHub Desktop.
Colima mac - auto-start
#!/bin/bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
function shutdown() {
colima stop
exit 0
}
trap shutdown SIGTERM
trap shutdown SIGKILL
trap shutdown SIGINT
# wait until colima is running
while true; do
colima status &>/dev/null
if [[ \$? -eq 0 ]]; then
break;
fi
colima start
sleep 5
done
tail -f /dev/null &
wait \$!
<?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>Label</key>
<string>com.github.abiosoft.colima</string>
<key>Program</key>
<string>/opt/local/bin/colima-start</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
alias colimaStop="launchctl unload -w $HOME/Library/LaunchAgents/com.github.abiosoft.colima.plist"
alias colimaStart="launchctl load -w $HOME/Library/LaunchAgents/com.github.abiosoft.colima.plist"
@chrissearle
Copy link
Author

Mac 13.5.1 seemed to have issues - found this bug:

abiosoft/colima#746

TL;DR:

brew reinstall -f --force-bottle qemu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment