Ubuntu – How to use PuTTY to get X11 connections over ssh from Windows to Ubuntu

puttysshx-forwarding

I need to get remote X11 terminal access from Windows machines into my Ubuntu 16.04 system. I am choosing not to use RDP for this since this only affects the two Windows clients.

From the other Linux boxes it is simple, especially since they use RSA authentication:

pi@rover$ ssh -Y prime5

and wham, bam, I just get the prompt

pi@PRIME5:~$

But from Windows I use PuTTY which gives a great CLI connection. Quick and easy, and it saves creds so the connections are made very quickly.

When I type this on the Ubuntu command line

pi@PRIME5:~$ echo $TERM
norm

Which means that GUI applications will not run.

I see PuTTY has the X11 option.

enter image description here

But it throws an error instead of working.
It needs an X server on the client side to work with Putty.


Question is in the title: How to use PuTTY to get X11 connections over ssh from Windows to Ubuntu?

Best Answer

Michigan Tech has a very succinct explanation of how to use Xming here:

Installing/Configuring PuTTy and Xming

Excerpt:

The PC interacts with the server through the X-windows system, forwarding the display from the server to the PC. Software must be installed on the PC to make this link work and the best software (so far) for this task is the PuTTy terminal emulator and the Xming X-window client.

PuTTy can be downloaded from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Xming can be downloaded from http://sourceforge.net/project/downloading.php?group_id=156984&filename=Xming-6-9-0-31-setup.exe

Once Xming is installed, run the application called 'XLaunch' and verify that the settings are:

1)  Display Settings:  Multiple Windows
2)  Session Type:  Start no client
3)  Additional Parameters:  Check Clipboard box

Then in your PuTTY session you can turn on the X11: Enable X11 Forwarding

enter image description here

So then save that, and every time that session is invoked you will get a GUI connection to Ubuntu, as long as Xming is running.

Xming is verified by the visible icon in the lower right of the screen like so:

enter image description here

In the Xlaunch settings it is selected to not run on startup, so when you don't see that icon then click on Start, type xming and press enter and it will start the x-server and show the icon.

Now, when you make the connection, then you can see

pi@PRIME5:~$ echo $TERM
xterm

The leafpad editor, gnome-system-monitor, etc., work over the link via the Xming server on Windows.

It is easy to pull up nautilus and browse to

/usr/share/applications

to get any of the installed system commands, as shown here:

enter image description here


Voila, X11 via SSH from Windows to Ubuntu.

Related Question