X11 forwarding with Bitvise SSH Client

The X11 forwarding feature in Bitvise SSH Client provides one way for an SSH connection to access graphical applications running on the SSH server. X11 forwarding is an alternative to forwarding a Remote Desktop or VNC connection. It differs from Remote Desktop or VNC in that remote application windows appear seamlessly in the client's desktop, without forwarding a complete desktop. X11 forwarding is best used with Unix-style servers running applications intended to run under X11. For connections to Windows servers, Remote Desktop is the native option.

Installing an X11 server

In order to use X11 forwarding, an X11 server needs to be installed on the client. One such server is available as part of Cygwin.

To install the Cygwin X11 server without installing the entire (and large) Cygwin platform, perform the following steps in the Cygwin installer:

  1. Proceed to the Select Packages page. On this page, you should see a package tree with All as the root.

  2. Unless you're installing other parts of Cygwin, keep the New column setting for All set to Default. (screenshot)

  3. Find the package All / X11 / xorg-server and change its New column setting to the current stable version. (screenshot)

  4. Proceed to the next page and complete the installation.

Starting the Cygwin X11 server

You can start the Cygwin X11 server by executing:

C:\cygwin64\bin\XWin -listen tcp -multiwindow

If the X11 server starts successfully, a new X-resembling icon will appear in the task bar notification area (the system tray). To close the X11 server, right click on the icon and select Exit from the right-click menu.

If the X11 server fails to launch, an error message will be displayed. A common failure reason is that an X11 server is already running. It is possible to run multiple X11 servers on the same computer, but each will need to be associated with a unique display number. For example, to start the X11 server on display 3, you would execute:

C:\cygwin64\bin\XWin :3 -listen tcp -multiwindow

Notes:

  • We do not recommend opening the firewall for the X11 server (the XWin.exe process).
  • Your Cygwin directory may be in a different location. For example, it could be C:\cygwin on a 32-bit system.

Setting up Bitvise SSH Client

In the SSH client's Terminal tab, enable X11 forwarding. If your X11 server runs on a non-default display (a display other than 0), the setting X11 Forwarding - Display will need to be changed, as well. For example, if your X11 server runs on display 3, change the setting to: 127.0.0.1:3.0.

Use the Login button to establish an SSH connection. Open a terminal console, and in it, run an X11 program (e.g. xemacs). The program should appear in a new window on your screen.