Saturday, June 10, 2017

X11 forwarding using Xming X server for Windows

Problem statement:

Let's say, We have 2 two computers: One with Ubuntu OS and other with Windows OS
Through SSH connection, "How can we access the any application's interface (GUI) installed on Ubuntu computer from Windows computer ?". For example, we want to access the GUI of calculator application that is installed on Ubuntu from Windows computer.

Environment:

First computer:
                       OS- Ubuntu 14.04 64-bit
                       Openssh-server package
Second computer:
                       OS- Windows 8 64bit
                        Xming software tool

Here, for demonstration, we will open GUI of calculator application
The command to open the calculator in Ubuntu is gnome-calculator                      

Step-1:
On Ubuntu Computer, install openssh-server package.

Perform Step-2 to 5 on Windows computer.
Step-2:
On Windows computer: 
Download Xming for Windows 8 64bit.
Install Xming executable file. You don't have to do any changes. Leave everything to the default selection.

Step-3: 
Now open command prompt on Windows computer
Change the directory to the location where Xming is installed. In my case it is "C:\Program Files (x86)\Xming"


cd "c:\Program Files (x86)\Xming"

Step-4:
Now enter the following command to start Xming on Windows


Xming.exe -multiwindow -clipboard


Step-5:
Now its the time to connect to the Ubuntu computer through inbuilt putty. In this step, you need to provide the login information, and the command to open required application.

The command can be

plink -ssh -2 -X user1@<IP of ubuntu computer> -P <port number of SSH server> <command to open the required application>



e.g.

plink -ssh -2 -X chinmaya@120.162.56.85  -P 23 gnome-calculator


Here, I am connecting to the Ubuntu computer through ssh protocol 2.
The IP address and SSH port number of Ubuntu computer is 120.162.56.85 and 23, respectively.
gnome-calculator is the command to open the GUI of calculator application.

After entering the above command, you need to give the corresponding password. If all goes well, the required GUI will appear on Wondows computer.

Please comment if you need more information or if you have any suggestion.

-Thank you



No comments:

Post a Comment