Wednesday, 29 January 2020

Configure X11 Forwarding with PuTTY and Xming for turned on Graphical mode in Linux.

Configure-X11-Forwarding-PuTTY-to-Xming-on-Windows


Usually, Graphical mode is turned off in Linux servers due to Security and Resource optimization.
In such environments running a GUI application is not a trivial task. However, we can use putty
and Xming to forward X11 display to a windows client over SSH protocol.

In this article, we will first install required packages on our Linux Server, then we will configure 
XMing and PuTTY for X11 forwarding on Windows.

This Article Provides:

System Specification:
One Microsoft Windows client and a Linux server.

Required Software:
Download and Install following two software on Windows client.
PuTTY
XMing X Server for Windows
Install required packages on Linux server:
Connect to Linux machine and install necessary packages for X11 forwarding.


[root@junit-01 ~]# yum install -y xauth
...
Installed:
  xorg-x11-xauth.x86_64 1:1.0.9-1.el7

Dependency Installed:
  libXmu.x86_64 0:1.1.2-2.el7        libXt.x86_64 0:1.1.5-3.el7

Complete!

We will require a Linux GUI application to test X11 forwarding configurations.
Therefore, we are installing xclock to test the configuration.

[root@junit-01 ~]# yum install -y xclock
...
Installed:
  xorg-x11-apps.x86_64 0:7.7-7.el7

Dependency Installed:
  libXaw.x86_64 0:1.0.13-4.el7         libXcursor.x86_64 0:1.1.15-1.el7
  libXfixes.x86_64 0:5.0.3-1.el7       libXft.x86_64 0:2.3.2-2.el7
  libXpm.x86_64 0:3.5.12-1.el7         libXxf86vm.x86_64 0:1.1.4-1.el7
  libxkbfile.x86_64 0:1.0.9-3.el7

Complete!

Configure XMing:
After installing Xming on Windows run xlaunch application.

[putty-configure-x11-forwarding-on-windows-01%5B2%5D]

Click on OK

[putty-configure-x11-forwarding-on-windows-02%5B2%5D]

Default configuration will work for us. Therefore, click on Next.

[putty-configure-x11-forwarding-on-windows-03%5B2%5D]

Click on Next.

[putty-configure-x11-forwarding-on-windows-04%5B2%5D]

Click on Next.

[putty-configure-x11-forwarding-on-windows-05%5B2%5D]

Click on Finish.

XMing application has been started and it is placed in System Tray of Windows.

Configure PuTTY:
Once installed, run PuTTY application.

[putty-configure-x11-forwarding-on-windows-06%5B2%5D]

Add a session of our Linux machine therein.





















Besides other configuration, we are also required to configure X11 forwarding as follows:

[putty-configure-x11-forwarding-on-windows-08%5B2%5D]

Save and open the session.

login as: root
Authenticating with public key "rsa-key-20190101"
Last login: Thu Jan  23 16:16:23 2020 from 10.24.248.38
/usr/bin/xauth:  file /root/.Xauthority does not exist
[root@erpclnapx ~]# xclock

Xming will capture the Display open a window to run xclock application.

[putty-configure-x11-forwarding-on-windows-09%5B2%5D]

We have successfully configured X11 forwarding using PuTTY and XMing.

No comments:

Post a Comment