Skip to content

Conversation

@felixzsh
Copy link
Contributor

@felixzsh felixzsh commented Dec 21, 2025

The current 5-second sleep is not enough for all hardware. On my PC (and likely many others), Windows takes longer to initialize. If the script tries to connect via RDP before Windows is fully ready, the connection fails or hangs.

I replaced the hard-coded sleep with a dynamic loop that checks the Docker logs for the "Windows started successfully" message. This ensures the RDP client only starts once Windows has confirmed it's ready, making the launch process much more reliable across different hardware specs.

Fixes #2599

@felixzsh felixzsh force-pushed the fix-windows-vm-lauch-sleep branch from 6f53705 to a756406 Compare December 21, 2025 22:10
@felixzsh felixzsh changed the title fix: improve windows-vm boot detection fix: improve Windows VM boot detection for RDP Dec 21, 2025
@felixzsh felixzsh changed the title fix: improve Windows VM boot detection for RDP fix: dynamic Windows VM boot synchronization for RDP Dec 22, 2025
@felixzsh felixzsh force-pushed the fix-windows-vm-lauch-sleep branch from a756406 to d0fe8ea Compare December 22, 2025 00:35
@felixzsh
Copy link
Contributor Author

felixzsh commented Dec 22, 2025

for further revision, i can see how the RDP port and the windows vm loops could be unified like this:

    echo "waiting for windows vm to start..."
    WAIT_COUNT=0
    # check RDP port
    until nc -z 127.0.0.1 3389 2>/dev/null && \
          # check for windows start message
          docker logs omarchy-windows 2>&1 | grep -qi "windows started successfully"; do
      sleep 2
      WAIT_COUNT=$((WAIT_COUNT + 1))
      if [ $WAIT_COUNT -gt 60 ]; then # 2 minutes timeout
        echo "❌ timeout: windows vm failed to start within 2 minutes"
        echo "   the vm might still be installing windows."
        echo "   check progress at: http://127.0.0.1:8006"
        echo "   check logs: docker logs omarchy-windows"
        exit 1
      fi
    done

but i dont know what is the best, clean and lees code, or separated timeout errors

@felixzsh felixzsh force-pushed the fix-windows-vm-lauch-sleep branch from d0fe8ea to db34d72 Compare December 22, 2025 03:04
The current 5-second sleep is not enough for all hardware. On my PC (and
likely many others), Windows takes longer to initialize. If the script
tries to connect via RDP before Windows is fully ready, the connection
fails or hangs.

I replaced the fixed sleep with a dynamic loop that checks the Docker
logs for the "Windows started successfully" message. This ensures the
RDP client only starts once Windows has confirmed it's ready, making the
launch process much more reliable across different hardware specs.

Fixes basecamp#2599
@felixzsh felixzsh force-pushed the fix-windows-vm-lauch-sleep branch from db34d72 to 85e5fc8 Compare December 22, 2025 03:54
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.

1 participant