net: fix missing network address when emulating a foreign arch - #1638
Merged
abiosoft merged 1 commit intoSep 15, 2026
Merged
Conversation
abiosoft
approved these changes
Sep 14, 2026
abiosoft
requested changes
Sep 14, 2026
abiosoft
left a comment
Owner
There was a problem hiding this comment.
Only human commits are allowed.
Also, kindly sign your commit(s).
anandghegde
force-pushed
the
fix-network-address-foreign-arch
branch
from
September 14, 2026 11:50
047e5bc to
06b27c7
Compare
Contributor
Author
|
@abiosoft Commit is not signed |
Owner
|
Kindly remove claude as a co-author of your commit. Only human committers are allowed. |
anandghegde
force-pushed
the
fix-network-address-foreign-arch
branch
from
September 15, 2026 16:38
06b27c7 to
1410c61
Compare
Contributor
Author
|
Done — dropped the co-author trailer and force-pushed. Commit is otherwise unchanged and still signed 👍 |
Owner
|
Lastly, can you kindly rebase, just to ascertain there would be no conflicts. |
vz and krunkit cannot run a foreign architecture, so newConf falls back to QEMU for e.g. `--arch x86_64` on Apple Silicon. startDaemon decided whether vmnet is needed from the configured vmType instead, so with the default `vz` the vmnet daemon was never started, col0 was never attached and `--network-address` silently produced no address. Derive the effective VM type in one place and use it for both. Signed-off-by: Anand Hegde <anandghegde@gmail.com>
Contributor
Author
|
Rebased onto latest main (f450fa7) — no conflicts, build and |
anandghegde
force-pushed
the
fix-network-address-foreign-arch
branch
from
September 15, 2026 18:17
1410c61 to
03e7aaf
Compare
abiosoft
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1304
Fixes #1556
Problem
On Apple Silicon,
colima start --arch x86_64 --network-addressstarts fine but the VM never gets a reachable address:colima lshas an empty ADDRESS column andcolima ls -jhas noaddressfield. The same happens with--vm-type vz --vz-rosetta --arch x86_64(#1556). @djzort's comment in #1336 shows the pattern clearly: with the default vm type there is no "preparing network" step and no address, while adding-t qemuprompts for the sudo password, prepares the network and the address shows up.Cause
vz and krunkit can't run a foreign architecture, so
newConfquietly falls back to QEMU when the guest arch differs from the host. QEMU needs vmnet to attachcol0.startDaemon, however, decides whether vmnet is needed from the configuredvmType. With the defaultvzit concludes vmnet isn't needed, dropsNetwork.Address, and never starts the vmnet daemon.newConfthen takes the QEMU/vmnet branch, finds vmnet not enabled in the context, and skipscol0without a warning.Fix
Pull the "which VM type will Lima actually use" logic out of
newConfintolimaVMType(conf), and use it from bothnewConfand the vmnet decision instartDaemon(usesVmnet(conf)). There is no behaviour change for same-arch vz/krunkit/qemu setups.Testing
Test_usesVmnetandTest_limaVMTypeinenvironment/vm/lima. They are host-independent: the "foreign" arch is whichever one the runner isn't.Test_usesVmnet/vz_foreign_arch_falls_back_to_qemufails against the old condition (usesVmnet() = false, want true) and passes with the fix.go test ./...,go vet,GOOS=linux go vet ./environment/vm/lima/andgolangci-lint run(0 issues) all pass on macOS 26 / arm64.Side note, not changed here:
colima statusstill says "macOS Virtualization.Framework" for these instances becauseDriverLabelalso reads the configuredvmType. I can follow up if you'd like that fixed too.AI disclosure: implemented with Claude Code (Claude Opus 5). I reviewed the change and ran the tests above.