Repository navigation
fix(cluster): run 32-bit x86 programs natively in an x86_64 Colima VM - #271
Merged
Merged
Conversation
With its binfmt setting on, Colima runs `binfmt --install 386,<foreign>` at every start, so an x86_64 VM also gets a qemu-i386 handler for its own architecture's 32-bit programs. binfmt_misc takes precedence over the kernel's loader, so every 32-bit program in a pod on such a node runs under qemu user emulation, where Wine's 32-bit side never finishes creating a prefix and a Windows installer build hangs. On a Colima host whose VM is x86_64 the role now switches off only the qemu-i386 entry: at once in the running VM, which restarts nothing, and after every start through an after-boot provision script it adds to the profile's colima.yaml, which Colima runs after its own binfmt setup and before the container runtime. Colima's binfmt setting stays on, so the foreign-architecture handler is kept, and an aarch64 VM is left alone.
Mearman
force-pushed
the
fix/colima-native-i386
branch
from
November 26, 2026 01:21
351daff to
d8c55d5
Compare
Mearman
marked this pull request as ready for review
November 26, 2026 02:07
|
🎉 This PR is included in version 3.6.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
A Colima VM that is x86_64 runs its own architecture's 32-bit programs under qemu. With
binfmton (Colima's default), everycolima startrunsbinfmt --install 386,<foreign arch>(core.SetupBinfmt), so an x86_64 VM gets aqemu-i386entry besideqemu-aarch64. binfmt_misc takes precedence over the kernel's loader, and Wine's 32-bit side never finisheswineboot --initunder emulation. On an Intel Mac node with Colima 0.10.3 the VM carries/proc/sys/fs/binfmt_misc/qemu-i386: enabled, interpreter/usr/bin/qemu-i386, flagsPOCF. A Windows installer build (electron-builder's NSIS step under Wine) placed on that node hangs, and its process list shows/usr/bin/qemu-i386 /usr/lib/wine/wine ....On a Colima host whose VM is x86_64,
tasks/colima_binfmt.ymlswitches off only that entry:0to the entry when it readsenabled. Nothing restarts: a 32-bit process already under qemu stays there, and every later one runs natively;after-bootprovision script added to the profile'scolima.yaml. Colima runs it after its own binfmt setup and before the container runtime (colimaApp.Start), so k3s never starts with the handler on. The script is idempotent and does nothing when the entry is absent. Existing provision scripts are kept. A running VM reads the file only at its next start, and Colima rewrites it from its commented template then.Colima's
binfmtstays on, so theqemu-aarch64handler is kept, which is the narrowest change. As far as I can tell nothing on an x86_64 node needs it (the image builder profile that cross-builds through QEMU is pinned to an arm64 node), but switching binfmt off wholesale would have taken it for no gain. An aarch64 VM is left alone, because 32-bit x86 is foreign there and itsqemu-i386handler is wanted.--checkreports the switch and writes nothing.Tests in
tests/unit/test_runtime_autostart.pycover an x86_64 VM (switched off now, provision script added, other settings untouched), a second run (no change), existing provision scripts (kept), a handler already off or absent (not written), a check run (reported, nothing written), an aarch64 VM (untouched), and the provision script itself run against a present and an absent entry. The two main ones fail with the task file emptied.How it takes effect: an inventory that pins this collection by tag takes it with the next release, a pin bump,
ansible-galaxy collection install -r requirements.yml --force, and a run of its site playbook limited to the x86_64 Colima hosts,--checkfirst.