Repository navigation
Conversation
The VM would install and run once, then fail every subsequent launch with "Failed to start Windows VM!" and no further explanation. prepare_caller_mounts hardens both bind sources to 0700 and then verifies they are exactly 700. The container's Samba layer chmods the shared folder to 2777 so it can serve it to the guest, and that lands on the caller's ~/Windows through the bind. Numeric modes below 010000 leave a directory's setuid and setgid bits untouched, so the hardening step turned 2777 into 2700 rather than 700 and the verification below it then rejected the source the script had just tried to fix. The first launch worked because Samba had not dirtied the folder yet; every launch after it failed. Spell both chmods symbolically with an explicit a-s so the hardening can actually reach the state its own check demands, and say something on the way out of the two silent exits, which is why this presented as a launcher that did nothing at all.
|
Reviewed at 979e885 and reproduced on a worker built from the Omarchy ISO (coreutils 9.11). The fix holds. Reproduction. In a private mount namespace, the first launch hardens both sources and succeeds. Setting Tests. Review. Claude Opus 5.5 reviewed the diff and the code around it. The exact- Related. #12264 makes the same chmod change and also moves where the launcher entry is created. That is a separate change, with its own trade-off on the Remove menu after a failed first start. It is not a reason to close this one. #10338 is older and fixes only this bug, so both models recommend it as the fix for this bug. #12264's removal regression test would be worth keeping whichever lands. I've flagged both to the maintainer, and this now waits on their decision. |
|
Closing this alternative after #12323 merged into Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup. Omabot on behalf of DHH |
Problem
The Windows VM installs and runs once, then every launch after that fails with:
Launched from the app icon,
windows-vm.desktophasTerminal=false, so even that message goes nowhere — clicking Windows does nothing at all, with no notification and nothing in the journal beyond the scope starting and exiting.Cause
prepare_caller_mountshardens both bind sources to0700and then verifies they are exactly700(bin/omarchy-windows-vm:583):The container's Samba layer chmods the shared folder to
2777so it can serve it to the guest (chmod 2777 "$dir"in/run/samba.shindockurr/windows)./sharedis a bind of the caller's~/Windows, so that setgid bit lands on the host directory.A numeric mode below
010000leaves a directory's setuid and setgid bits untouched. So the hardening step turns2777into2700rather than700, and the check immediately below it then rejects the source the script has just tried to fix. On coreutils 9.11:The first launch works because Samba has not dirtied the folder yet. Every launch after it fails, and it fails before reaching Docker at all, which is why nothing shows up in
docker ps -aor the daemon log.prepare_user_mount_sourceshardens the same two directories on the install path (:1018) and has the same defect.Fix
Spell both chmods
u=rwx,go=,a-sso the hardening can actually reach the state its own check demands.chmod 00700also works, but only because the GNU carve-out keys on the length of the octal string rather than its value — it reads like a typo and invites being "cleaned up" straight back into the bug, so the symbolic form seemed worth the few extra characters.Also give the two silent
return 1exits something to say. The mode check is still worth keeping as defence in depth: it now catches a source on a filesystem that ignoreschmodrather than failing mute.Verification
On an affected machine,
~/Windowsat2700going in, running the privileged bring-up directly:~/Windowsafter/usr/bin/omarchy-windows-vm1(silent, 5s, never reaches Docker)27000700Full launch cycle through the app icon then works repeatedly, where before it succeeded exactly once per fresh install.
test/shellrun before and after: 6 pre-existing failures, identical with and without this change (bar-icon-geometry,bin-style,config,snapper,unowned-system-paths,windows-vm-mount-boundary).Worth a separate look:
windows-vm-mount-boundary-test.shcannot pass on a machine where the VM has been launched since boot. It builds a fake uid-1000 home underunshare --user --mount, but that namespace inherits the real binds at/var/lib/omarchy/windows/mounts/users/1000/*, which point at the actual home, somounted_leaf_matchesrejects them. Mounts inherited into a user namespace are locked, so the test cannot unmount them to isolate itself either. Not touched here.🤖 Generated with Claude Code
https://claude.ai/code/session_01WB1hMW2yRN5tHRsVKon9UG