Install
openclaw skills install rdptunnelExpose local RDP (Remote Desktop) servers to the public internet via aitun TCP tunnel with TLS-based routing. Perfect for AI agents that need to provide remote desktop access to Windows machines, GUI servers, or VDI instances behind NAT/firewall.
openclaw skills install rdptunnelUse this skill when:
Do NOT use this skill when:
pip install aitun
Or verify it is already installed:
which aitun || pip show aitun
Verify the local RDP service is running and accessible:
On Windows:
# Check if Remote Desktop is enabled
Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections
# Enable Remote Desktop (0 = enabled, 1 = disabled)
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
# Ensure the RDP service is running
Get-Service -Name TermService | Start-Service
On Linux (xrdp):
# Install xrdp
sudo apt install xrdp -y # Debian/Ubuntu
sudo yum install xrdp -y # CentOS/RHEL
# Start xrdp service
sudo systemctl start xrdp
sudo systemctl enable xrdp
# Verify it is listening on port 3389
ss -tlnp | grep :3389
RDP uses TCP port 3389 by default. Use aitun's --tcp-ports flag to forward this port. TCP forwarding requires an auth token (register at https://aitun.cc):
aitun -p 3389 --tcp-ports 3389 -k YOUR_TOKEN &
AITUN_PID=$!
sleep 3
The output will show:
[TCP] rdp -> localhost:3389 (subdomain: yourname.t.aitun.cc:3389)
If port 3389 is occupied on the server, a port from the 7000-7999 range will be automatically assigned.
From any machine on the internet:
Windows (Remote Desktop Connection):
Win + R, type mstsc, press Enteryourname.t.aitun.cc:3389 as the computer nameLinux (FreeRDP):
xfreerdp /v:yourname.t.aitun.cc:3389 /u:username /cert:ignore
macOS (Microsoft Remote Desktop):
yourname.t.aitun.cc:3389 as the PC nameWhen done, stop the tunnel:
kill $AITUN_PID 2>/dev/null
aitun -p 3389 --tcp-ports 3389,22 -k YOUR_TOKEN &
AITUN_PID=$!
sleep 3
If RDP is running on a non-standard port (e.g., 13389):
aitun -p 13389 --tcp-ports 13389 -k YOUR_TOKEN &
# Container running xrdp on port 3389, mapped to host port 13389
aitun -p 13389 --tcp-ports 13389 -k YOUR_TOKEN &
# Then connect:
# xfreerdp /v:yourname.t.aitun.cc:13389 /u:username
aitun v4.7.0 uses TLS with SNI for all TCP tunnel routing:
Note: RDP clients connect directly without ProxyCommand (unlike SSH which needs aitun ssh-proxy), because RDP traffic is routed at the TCP level by the server based on SNI from the initial TLS handshake.
The aitun command (installed via pip install aitun) accepts these flags:
| Flag | Description |
|---|---|
-p PORT | Local service port (default: 8080) |
-k TOKEN | Auth token for registered subdomain (required for TCP forwarding) |
--host HOST | Local service address (default: localhost) |
--tcp-ports PORTS | TCP forwarding ports, comma-separated (e.g., 3389,22; requires -k) |
--p2p | Enable P2P direct connection (default: enabled) |
--no-p2p | Disable P2P, force server relay mode |
--daemon | Run as background daemon |
--stop | Stop running daemon |
Subcommand:
| Command | Description |
|---|---|
aitun ssh-proxy <host> [port] | SSH ProxyCommand — wraps SSH in TLS for SNI routing |
-k token — free tunnels do not support TCP--no-p2p only if P2P connection fails--daemon for persistent background operation