···2929docker-compose up &
3030COMPOSE_PID=$!
31313232-# Wait for RDP port to be available and RDP service to be ready
3333-echo "Waiting for RDP port to open..."
3434-while ! nc -z 127.0.0.1 3389; do
3535- echo " Port 3389 not ready yet..."
3636- sleep 10
3232+# Wait for container to be running
3333+echo "Waiting for Windows container to start..."
3434+while true; do
3535+ CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' windows 2>/dev/null)
3636+ if [ "$CONTAINER_STATUS" = "running" ]; then
3737+ echo "Container is running!"
3838+ break
3939+ fi
4040+ echo " Container status: $CONTAINER_STATUS"
4141+ sleep 2
37423843 # Check if docker-compose process is still running
3944 if ! kill -0 $COMPOSE_PID 2>/dev/null; then
···4247 fi
4348done
44494545-echo "Port 3389 is open, waiting for Windows VM to fully initialize..."
4646-echo "This can take 2-3 minutes for Windows to boot completely..."
5050+# Check if web interface is responding (faster than waiting for RDP)
5151+echo "Checking if Windows VM web interface is responding..."
5252+while true; do
5353+ if curl -s --connect-timeout 5 http://127.0.0.1:8006 > /dev/null 2>&1; then
5454+ echo "Web interface is responding at http://127.0.0.1:8006"
5555+ break
5656+ fi
5757+ echo " Web interface not ready yet..."
5858+ sleep 3
5959+done
47604848-# Additional wait for Windows to fully boot and RDP service to be ready
4949-sleep 60
6161+# Now wait for RDP port specifically
6262+echo "Waiting for RDP service to be ready..."
6363+while ! nc -z 127.0.0.1 3389; do
6464+ echo " RDP port not ready yet..."
6565+ sleep 5
6666+done
50675151-# Test RDP connection availability
5252-echo "Testing RDP connection..."
5353-timeout 10 rdesktop -g 640x480 -u docker 127.0.0.1:3389 -p admin 2>/dev/null
6868+echo "RDP port is open, testing connection..."
6969+# Quick RDP test with shorter timeout
7070+timeout 5 rdesktop -g 1920x1200 -u docker 127.0.0.1:3389 -p admin 2>/dev/null
5471if [ $? -ne 0 ]; then
5555- echo "RDP not fully ready yet, waiting another 30 seconds..."
5656- sleep 30
7272+ echo "RDP not fully ready yet, waiting 20 more seconds..."
7373+ sleep 20
5774fi
58755976echo "Starting RDP connection..."
···6380$RDP_COMMAND
64816582# If RDP exits, cleanup
6666-cleanup8383+cleanup
···22Name=Windows VM
33Comment=Start Windows VM via Docker and connect with RDP
44Exec=uwsm app -- /home/sspaeti/.config/hypr/sspaeti/windows-ms/start-windows.sh
55-Icon=computer
55+Icon=/home/sspaeti/.local/share/applications/icons/windows.png
66Terminal=false
77Type=Application
88-Categories=System;Virtualization;88+Categories=System;Virtualization;