Reverse RDP into Windows on GitHub Actions
Ever wonder what the Desktop of the Windows Runners on GitHub Actions looks like?
This functionality is like Appveyor's RDP functionality for their Windows workers:
- Assume Windows Runners cannot listen to ports. I didn't bother trying and ngrok worked anyway. So, signup for an ngrok account.
- Get the tunnel auth token at: https://dashboard.ngrok.com/auth .
- Under the repository's settings, make a secret called
NGROK_AUTH_TOKENand set it to the tunnel auth token from ngrok.
- Trigger a build somehow. Maybe make a spurious commit or edit and commit the README or something.
- Wait until the last step which will hang forever as it connects to ngrok and sets up the reverse tunnel.
- Visit ngrok's dashboard. https://dashboard.ngrok.com/
- Note the active tunnel's public host and port.
- Connect to the host and port combination with your RDP client of choice.
- Use the username
runneradminand the password
- Enjoy! ☕
- When you're done introspecting, cancel the job.
These steps should be useful for debugging broken builds directly on the build worker. Use this project as reference and toss the steps into your project after some failing part of the build for introspection.
- Runners can run jobs for up to 6 hours. So you have about 6 hours minus the minute setup time to poke around in these runners.
- If using for introspection, add the
continue-on-errorproperty to the failing step before these remote connection steps.
Maybe as a GitHub Action? Oh well, this is fairly simple anyway.