colima
colima copied to clipboard
Colima fails to start Rosetta, and reports that it's not installed.
Description
Colima detects if Rosetta is running and if it's not Colima will ask the user to install Rosetta 2.
The RosettaRunning function does the correct thing (checks if it's running), but for some reason the same function is called in colima/environment/vm/lima/yaml.go to determine if it's installed.
In my case I have Rosetta installed, and when I call colima start I get a warning message noting that rosetta isn't installed, and asking me to install Rosetta. Colima then falls back to a very slow QEMU instance (comparison here).
I installed it so many times believing that it was being removed somehow. Thankfully, I'm able to look at the code (others might not get that far) to see what the issue is.
The ideal solution:
- Detect if Rosetta is installed
- If Rosetta is installed (and required), start it.
Version
colima version 0.6.9
git commit: c3a31ed05f5fab8b2cdbae835198e8fb1717fd0f
runtime: docker
arch: aarch64
client: v27.0.3
server: v26.1.1
limactl version 0.22.0
qemu-img version 9.0.2
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
Operating System
- [ ] macOS Intel <= 13 (Ventura)
- [ ] macOS Intel >= 14 (Sonoma)
- [ ] Apple Silicon <= 13 (Ventura)
- [x] Apple Silicon >= 14 (Sonoma)
- [ ] Linux
Output of 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:///Users/jd/.colima/default/docker.sock
Reproduction Steps
$ colima start
Expected behaviour
Colima uses Rosetta if installed and configured.
Additional context
No response
This may be of use to someone...
$ pkgutil --pkg-info com.apple.pkg.RosettaUpdateAuto
package-id: com.apple.pkg.RosettaUpdateAuto
version: 1.0.0.0.1.1715076803
volume: /
location: /
install-time: 1721278842
Rosetta doesn't always run if it's installed, unless you're logging in via the Desktop GUI, which admittedly most users would be doing.
I was attempting to run Colima from LaunchDaemon which is triggered upon boot where no users are yet logged in. The same thing happens when logging in via SSH etc.
Rosetta doesn't always run if it's installed, unless you're logging in via the Desktop GUI, which admittedly most users would be doing.
Thanks for the info
Thought I'd leave this here in-case anyone else runs into the same issue, the following shell script is callable from a LaunchDaemon and will prevent Colima from starting until Rosetta is started.
If at some point in the future Colima starts Rosetta if it's installed, then awesome. For now, It's either wait for Rosetta (what the script does) or Colima will fall back to QEMU even if your settings are set to Rosetta.
https://gist.github.com/realJoshByrnes/c89acc7734dec5f038004ffd0b5d4cf1