One-click SSH Tunnel with RDP (from Linux to a remote Windows PC)

Related: Windows to Windows SSH / RDP

Assume a remote Windows PC with SSH Cygwin Windows server or remote Linux PC with XRDP.

  1. install FreeRDP for X11 or Wayland
    apt install freerdp-x11

    I use FreeRDP 1.x since FreeRDP 2.x had disconnection bugs for me on Ubuntu 17.10. Alternative for Wayland users (also didn’t work for me):

    apt install freerdp2-wayland
  2. Select between X11 FreeRDP and Wayland FreeRDP:


Remote PC IP Remote PC SSH port Remote PC RDP port 22 (open TCP firewall) 3389 (blocked by remote PC firewall)
  1. create script on your laptop:
    ssh -f -L 4389:localhost:3389 [email protected] sleep 1;
    xfreerdp /v:localhost:4389
  2. make executable
    chmod +x
  3. Setup SSH tunnel and connect to the RDP Windows desktop from Linux laptop:


I found wlfreerdp (version 2.0.0) on Ubuntu 17.10 to just show garbled graphics and not work.

I reverted back to FreeRDP 1.1.0 since with FreeRDP 2.0.0 on Ubuntu 17.10 I consistently got errors upon first mouse click after connecting:

[ERROR][com.freerdp.core] - freerdp_check_fds() failed - 0
[INFO][com.freerdp.client.x11] - Network disconnect!
[ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor
[ERROR][com.freerdp.channels.cliprdr.client] - cliprdr_order_recv failed with error 1359!
[ERROR][com.freerdp.core] - cliprdr_virtual_channel_client_thread reported an error. Error was 1359




Leave a Comment