How to see GUI on Remote (Linux) Machines?

30 / Oct / 2015 by Parampreet Singh 0 comments

It rarely happens that we need to see GUI for the Linux based remote servers. But what if you need to see that. The purpose of this post is to walk you through the software/steps required to fulfill this requirement. Here is how we can enable the GUI

First of all we have to install vncserver on remote machine

For Ubuntu
Selection_007

For Redhat
Selection_008

Then start a display and telling the display port along as a command line argument. This will be used by an application that require displays.

Selection_009

Above we are using display port as :3. If omitted, the next free display number is used

It will ask to type password for authentication. Type password. Re verify. Now display is on

For Ubuntu set password for authentication using vncpasswd command

You can see the list of existing displays using vncserver list option
Selection_010

For seeing what port is being used we will grep from ps command
ps -eaf| grep vnc
Selection_016

Note down the -rfbport number for the corresponding display

Export the display system variable that will be used by firefox or any other ui application to use

Selection_013

Next is how we can see application running.
For that we need to remote desktop into the remote machine.

Do ssh tunnel.
Selection_014

Try to do remote desktop
Selection_017

Type localhost as server address and when promted for password, type the password entered earlier while opening display

If everything went fine, shall able to see the remote desktop!!!

Selection_018

One simple use-case could be if you want to see the Geb/functional tests running on server.
And I am planning to write another blog for this.

Hope this helps!!!

FOUND THIS USEFUL? SHARE IT

Leave a Reply

Your email address will not be published. Required fields are marked *