Skip to content

Fix Windows VM launch never opening an RDP window - #6893

Merged
dhh merged 3 commits into
omacom:quattrofrom
DataDave-Dev:fix-windows-vm-rdp-readiness
Aug 15, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
DataDave-Dev:fix-windows-vm-rdp-readiness

Conversation

@DataDave-Dev

Copy link
Copy Markdown
Contributor

Fixes #6882.

omarchy-windows-vm launch starts the container and then exits without ever opening an RDP window. From the user's side the VM just appears to refuse to start, and Terminal=false on the desktop entry hides every error. Two independent causes, one commit each.

Wait for the current Windows boot before connecting RDP

docker logs retains output across docker stop / docker start and is only cleared when the container is removed, so any container that outlives a session already holds Windows started successfully lines from previous boots. The readiness loop matched one of those on its first iteration and fired xfreerdp3 about a second after docker compose up -d, while the guest was still in firmware. On the affected machine the guest needs ~30s to reach that message, so the client was starting ~29s early.

The wait was also skipped entirely when the container was already running, which is not the same as the guest being up: the image restarts Windows in place whenever it reboots.

Anchoring the scan to .State.StartedAt and running it unconditionally covers both.

Skip Kerberos when connecting to the Windows VM

FreeRDP 3 attempts Kerberos before NTLM for NLA, and Arch's krb5 ships /etc/krb5.conf as the upstream MIT sample with default_realm = ATHENA.MIT.EDU. Every launch therefore tries to reach MIT's KDC:

  • with working internet the KDC answers with an error and FreeRDP falls back to NTLM in under a second, so nobody notices
  • with no or degraded internet each attempt blocks ~23s (Cannot contact any KDC for realm 'ATHENA.MIT.EDU') and xfreerdp3 sits in CLOSE-WAIT without drawing a window

Same symptom as the first bug, unrelated cause. This is the root cause behind #4365, which was closed without a change here. Pointing KRB5_CONFIG at a realm-less config makes Kerberos fail instantly and hands the connection to NTLM, which is what the local Windows account uses anyway. The config is written next to docker-compose.yml on first launch and left alone afterwards, so a user who does want Kerberos can edit it.

Verification

Measured on Omarchy 4.0.0, i9-12900H, freerdp 2:3.30.0-2, dockurr/windows v5.16, cold container start each time:

time to RDP window
before, container stopped rather than removed never — client fires early, connection resets
before, no internet never — hangs in Kerberos
after 36s, boot-bound

./test/all shows the same 5 pre-existing failures on this branch and on a clean quattro checkout (bar-icon-geometry, and three omarchy-pkgs checkout tests that need the sibling repo). test/shell.d/windows-vm-test.sh passes.

Not addressed here

launch still treats "RDP client exited" as "user is done" and stops the VM, so a connection failure silently tears the VM down — that is #5202 and wants its own change.

docker logs retains output across stop/start, so grepping the whole log
matched "Windows started successfully" from an earlier boot and returned
immediately, firing xfreerdp3 while the guest was still booting. Anchor the
scan to the container's current StartedAt, and run it even when the container
was already running, since the image restarts the guest in place on reboot.
FreeRDP 3 attempts Kerberos before NTLM for NLA, and Arch's stock
/etc/krb5.conf declares default_realm = ATHENA.MIT.EDU, so every launch tries
to reach MIT's KDC. Off the network each attempt blocks ~23s and xfreerdp3
sits in CLOSE-WAIT without drawing a window, which reads as the VM failing to
start. Point FreeRDP at a realm-less krb5 config so it falls through to NTLM,
which is what the local Windows account uses anyway.
Copilot AI balanced review requested due to automatic review settings August 14, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

A failed docker inspect left STARTED_AT empty, and docker logs drops the
--since filter when it is, putting the scan back on the whole retained log
and its stale success line. Sampling per poll also keeps the window on the
current boot if the container restarts mid-wait.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 15, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@dhh
dhh merged commit 75b99f7 into omacom:quattro Aug 15, 2026
@DataDave-Dev
DataDave-Dev deleted the fix-windows-vm-rdp-readiness branch August 15, 2026 14:42
dhh added a commit that referenced this pull request Aug 23, 2026
* Wait for the current Windows boot before connecting RDP

docker logs retains output across stop/start, so grepping the whole log
matched "Windows started successfully" from an earlier boot and returned
immediately, firing xfreerdp3 while the guest was still booting. Anchor the
scan to the container's current StartedAt, and run it even when the container
was already running, since the image restarts the guest in place on reboot.

* Skip Kerberos when connecting to the Windows VM

FreeRDP 3 attempts Kerberos before NTLM for NLA, and Arch's stock
/etc/krb5.conf declares default_realm = ATHENA.MIT.EDU, so every launch tries
to reach MIT's KDC. Off the network each attempt blocks ~23s and xfreerdp3
sits in CLOSE-WAIT without drawing a window, which reads as the VM failing to
start. Point FreeRDP at a realm-less krb5 config so it falls through to NTLM,
which is what the local Windows account uses anyway.

* Re-read the container start time on every readiness poll

A failed docker inspect left STARTED_AT empty, and docker logs drops the
--since filter when it is, putting the scan back on the whole retained log
and its stale success line. Sampling per poll also keeps the window on the
current boot if the container restarts mid-wait.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit 75b99f7)
@dhh dhh mentioned this pull request Aug 23, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* Wait for the current Windows boot before connecting RDP

docker logs retains output across stop/start, so grepping the whole log
matched "Windows started successfully" from an earlier boot and returned
immediately, firing xfreerdp3 while the guest was still booting. Anchor the
scan to the container's current StartedAt, and run it even when the container
was already running, since the image restarts the guest in place on reboot.

* Skip Kerberos when connecting to the Windows VM

FreeRDP 3 attempts Kerberos before NTLM for NLA, and Arch's stock
/etc/krb5.conf declares default_realm = ATHENA.MIT.EDU, so every launch tries
to reach MIT's KDC. Off the network each attempt blocks ~23s and xfreerdp3
sits in CLOSE-WAIT without drawing a window, which reads as the VM failing to
start. Point FreeRDP at a realm-less krb5 config so it falls through to NTLM,
which is what the local Windows account uses anyway.

* Re-read the container start time on every readiness poll

A failed docker inspect left STARTED_AT empty, and docker logs drops the
--since filter when it is, putting the scan back on the whole retained log
and its stale success line. Sampling per poll also keeps the window on the
current boot if the container restarts mid-wait.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows-vm: launch fires xfreerdp3 before the guest is ready because the readiness wait greps stale log lines

4 participants