Setting up X11 SSH Tunnel for Remote Desktop Access to a VM
In this article, we will discuss how to set up an X11 SSH tunnel to access a remote desktop (RDP) session on a Virtual Machine (VM) using PuTTY.
Prerequisites
To follow this guide, you will need:
- A Windows host machine
- A Linux VM with an RDP server installed (e.g., Ubuntu 22.04 with xrdp)
- PuTTY SSH client
Connecting to the VM using PuTTY and SSH Tunnel
1. Open PuTTY and enter the VM's IP address or hostname in the "Host Name (or IP address)" field under the "Session" category.
2. Under the "Connection > SSH > Tunnels" category, enter the following:
- Source port: a free port number on your Windows machine (e.g., 3389)
- Destination: localhost:
(default is 3389)
3. Click the "Add" button to add the tunnel.
4. Click the "Open" button to initiate the SSH connection to the VM.
Connecting to the RDP session using Remote Desktop Connection
1. Open the Remote Desktop Connection application on your Windows machine.
2. Enter the VM's IP address or hostname in the "Computer" field.
3. Click on the "Show options" button.
4. In the "Display" tab, select the "Use all my monitors" option.
5. In the "Local Resources" tab, click the "More..." button and add the following:
- Local device: Displays:
- Local device: Clientprinter:
- Local device: Ports: 3389:localhost:
(the port number you used for the SSH tunnel)
6. Click "OK" to save the settings and then click "Connect" to initiate the RDP session.
In this article, we discussed how to set up an X11 SSH tunnel using PuTTY to access a remote desktop session on a Linux VM with an RDP server installed. This setup allows you to access the VM's desktop remotely from a Windows machine.