omarchy-windows-vm launch fails silently after the first run — setgid on the shared mount breaks an exact `== 700` mode check
Intel i7-8650U (Kaby Lake), Intel UHD 620, 31 GiB RAM, Omarchy 4.0.4, kernel 7.2.5-3-omarchy
omarchy-windows-vm launch succeeds exactly once after install, then fails forever after:
Starting Windows VM (this may prompt for authorization)...
❌ Failed to start Windows VM!
Try checking: omarchy-windows-vm status
The privileged step exits 1 with no output at all on stdout or stderr, and never reaches Docker.
Root cause
prepare_caller_mounts hardens both bind-mount sources, then compares the resulting mode with an exact string match (omarchy-windows-vm:583):
chmod 0700 -- "/proc/$BASHPID/fd/$storage_fd" "/proc/$BASHPID/fd/$shared_fd" || {...}
storage_mode=$(stat -Lc '%a' "/proc/$BASHPID/fd/$storage_fd" 2>/dev/null) || storage_mode=""
shared_mode=$(stat -Lc '%a' "/proc/$BASHPID/fd/$shared_fd" 2>/dev/null) || shared_mode=""
if [[ $storage_mode != 700 || $shared_mode != 700 ]]; then
exec {storage_fd}<&-; exec {shared_fd}<&-; return 1
fi
Two problems compound:
stat -c %aincludes the setuid/setgid/sticky bits in the octal mode, andchmod 0700does not clear setgid on a directory. A source dir at mode2700therefore can never satisfy== 700, no matter how many times you chmod it:$ stat -c %a ~/Windows # 2700 $ chmod 0700 ~/Windows $ stat -c %a ~/Windows # 2700 <- still not "700"dockurr/windowschmods the shared mount (/shared) on every container start. Measured:700→2777.
Since __priv_up_wait calls assert_mounts_safe before dc up -d, the ordering traps it:
- First launch —
$HOME/Windowsis700, check passes, container starts, dockurr sets2777, RDP connects - RDP closes —
priv downruns, container removed - Every later launch —
$HOME/Windowsis2700/2777, check fails silently and Docker is never reached
Reproduction
chmod 2700 ~/Windows
pkexec /usr/bin/omarchy-windows-vm __priv up_wait # exits 1, prints nothing
Suggested fix
Clear setgid explicitly before comparing:
chmod g-s -- "/proc/$BASHPID/fd/$storage_fd" "/proc/$BASHPID/fd/$shared_fd" 2>/dev/null || true
chmod 0700 -- "/proc/$BASHPID/fd/$storage_fd" "/proc/$BASHPID/fd/$shared_fd" || {...}
Verified against 4.0.4 by driving the functions directly: with that one-line addition prepare_caller_mounts succeeds and normalizes the source back to 700 (tested from both 2700 and 2777); unpatched, the same call fails silently from both.
Note that masking the comparison instead ((( 8#$mode & 0777 )) == 700) would let 2700 pass but would still admit dockurr's 2777, leaving the shared folder setgid and world-writable — so clearing the bit is the better fix.
Two related problems worth addressing at the same time
-
The silent
return 1. Every other refusal inassert_mounts_safe/prepare_caller_mountswrites a diagnostic to stderr. This path is the only one that returns 1 with no message, which is what made this hard to find — it presents as an authorization or Docker failure rather than a permissions check. -
2777on the shared folder. dockurr leaves$HOME/Windowssetgid and world-writable for as long as the container runs, which is a local hygiene concern independent of the above.
Workaround in the meantime
chmod g-s ~/Windows && chmod 0700 ~/Windows && omarchy-windows-vm launch
No sudo needed — the directory is owned by the invoking user. Both calls are required: chmod 0700 alone does not clear setgid, and GNU chmod rejects combined forms like chmod 0700,g-s.
Following the merge of #12323, The setgid launch failure and missing mode diagnostic are fixed. The container can still make the shared directory world-writable while it runs; that remains unresolved and this issue stays open to track it, including the same concern in #12333.
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
Additional confirmation from an installed system diagnosed on October 6, 2026:
- Omarchy package:
4.0.0.r6720.g8e02fc8-1 - Kernel:
7.2.5-4-omarchy, x86_64 - Docker:
1:29.8.2-1; docker-compose:5.6.0-1; coreutils:9.12-2 - Standard root-owned configuration and polkit authorization, with the user outside the docker group.
The installed /usr/bin/omarchy-windows-vm still uses chmod 0700 in prepare_caller_mounts() followed by the exact 700 comparison, so it does not yet contain the change from #12323. This is confirmation on an older installed build, not a claimed regression in the merged fix.
At failure, ~/.windows was mode 700 and ~/Windows was 2700, both owned by the user. Clearing setgid with chmod g-s "$HOME/Windows" allowed the packaged privileged up_wait action to start the container and complete its readiness check. TCP port 3389 then accepted a connection.
After that successful startup, both ~/Windows and /var/lib/omarchy/windows/mounts/users/<uid>/shared were observed at mode 2777. Inspection of the running dockurr/windows container found chmod 2777 "$dir" in /run/samba.sh at lines 139 and 159. This also confirms the remaining runtime shared-folder mode behavior tracked here. The image digest was not collected.
A local desktop-launcher workaround clears setgid before invoking the stock launcher. No packaged Omarchy source was modified. Thanks for the upstream fix in #12323.
Additional reproduction on an installed pre-fix Omarchy build, with a different Docker access path:
- Host:
omarchy-dev 4.0.0.r6720.g8e02fc8-1(built Oct 3, before #12323 merged Oct 4), kernel7.2.5-4-omarchy, Docker 29.8.2, Compose 5.6.0; user is in the docker group. - Before launch:
~/.windowswas mode700,~/Windowswas mode2700;omarchy-windows-vm statusreported the stopped container. The desktop entry'suwsm app -- omarchy-windows-vm launchfailed with the generic “Failed to start Windows VM!” and the container never started. Polkit did authorize the privilegedup_waitstep. - Independent mode repro: on a disposable directory,
chmod g+smade mode2700;chmod 0700left it at2700;chmod g-sproduced700. - Clearing only setgid with
chmod g-s "$HOME/Windows", then retrying the same desktop launcher, started the container. Docker logged “Windows started successfully” and Hyprland showed anxfreerdpwindow titled “Windows VM - Omarchy”. - With an empty share, the container changed
~/Windowsback to2777while running. I restored mode700and created a mode-600~/Windows/.keepplaceholder so the share is not empty at a future start. That future-start workaround has not been retested yet; the current VM remains running. No packaged Omarchy files were edited or private logs uploaded.
This confirms the docker-group path and the outstanding runtime world-writable share on an older installed build. It is not a claimed regression of merged PR #12323.
Filed by a Pi coding assistant (the exact model ID is not exposed in this session).
Re-checked against quattro at da2db1a. The launch failure in the title is fixed there by #12323: prepare_caller_mounts and the install-side hardening now use chmod u=rwx,go=,a-s, which clears setgid (bin/omarchy-windows-vm:591 and :1027), and a failed check now prints both paths and their modes (:601). The two later reports are from 4.0.0.r6720 builds made before that merge, which fits.
The part this issue stays open for is real, and it is more than tidiness. dockurr/windows's samba.sh runs chmod 2777 on the share when it is empty at container start. Nothing in the script puts the mode back after dc up -d (__priv_up at :905, __priv_down at :907, __priv_up_wait at :911), so ~/Windows stays 2777 from the first start until the next launch hardens it again, including after the VM is stopped. A private $HOME does not contain it: the same directory is bind-mounted at /var/lib/omarchy/windows/mounts/users/<uid>/shared, whose root-owned parents are 0711 (:307-309). Any local user who knows the UID can reach it there, and while it is 2777 they can list, create, rename and delete entries in it. On a single-user machine nobody else can do that, so nothing goes wrong in practice there.
That comes from reading the source and from what the reporters here measured. Both saw 2777 on ~/Windows and on the /var/lib path. It was not reproduced on a worker, because that needs the Windows container running.
I have not opened a fix, because each option is a design choice for the privileged helper:
- Re-apply the hardening to the pinned shared directory once the container reports ready, in
__priv_up_waitand in__priv_up, which install uses. Samba in the container runs withforce user = root, so the share should stay usable. The directory would still be open briefly during each start. - Keep the share non-empty so dockurr never changes its mode. This leaves a file the user can see, and it relies on a detail of upstream's code.
- Tighten the
0711parents. They are presumably0711so the read-only checks a docker-group user runs can reach the mounts.
Until then, upstream's code only changes the mode of an empty share, so a ~/Windows with a file in it should be left alone. That has not been tested here. This waits on the maintainer to pick an approach.
Checked by Claude Opus 5.5 and, separately, by Codex Medium. Codex Medium is the one that found the 0711 route around a private home. Independence is not guaranteed.
Fixed in Omarchy 4.0.5 by #12323. Update with omarchy update (or Update > Omarchy). If it still happens on 4.0.5, comment here and we'll reopen.