···6677SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
88# RDP_COMMAND="rdesktop -g 1600x1000@144 -P -z -x l -r sound:off -u docker 127.0.0.1:3389 -p admin"
99-# Note: added `-grab-keyboard` for avoiding terminal interuptions. e.g. ctrl+c is terminating RDC, but can be used for copying
99+# Note: added `-grab-keyboard` for avoiding terminal interruptions. e.g. ctrl+c is terminating RDC, but can be used for copying
1010RDP_COMMAND="xfreerdp3 /u:docker /p:admin /v:127.0.0.1:3389 /size:1600x1000 +f /cert:tofu -grab-keyboard /scale:140"
11111212echo "Starting Windows VM..."
···6868done
69697070echo "RDP port is open, testing connection..."
7171-# Quick RDP test with shorter timeout
7272-timeout 5 rdesktop -g 320x240 -u docker 127.0.0.1:3389 -p admin 2>/dev/null
7171+# Quick RDP test with shorter timeout - xfreerdp3 with certificate acceptance
7272+timeout 5 xfreerdp3 /u:docker /p:admin /v:127.0.0.1:3389 /size:320x240 /cert:tofu 2>/dev/null
7373if [ $? -ne 0 ]; then
7474 echo "RDP not fully ready yet, waiting 5 more seconds..."
7575- sleep 5
7575+ sleep 5
7676fi
77777878echo "Starting RDP connection..."
7979echo "When you close RDP, the Windows VM will automatically shut down."
80808181-# Start RDP in new session to isolate from terminal signals (otherwise ctrl+c for copying will stop everything)
8181+# Start RDP in new session to isolate from terminal signals (otherwise ctrl+c for copying will stop everything)
8282setsid $RDP_COMMAND
83838484# If RDP exits, cleanup
8585cleanup
8686+