Home > Uncategorized > Running GUI via putty

Running GUI via putty

At times we have to invoke some sort of gui client ( let’s say Oracle Installer etc ) from putty. It can be a pain to have it started, but if things are configured properly it’s not that difficuilt.

For this exercise, we would require following software

1) Putty

A free open source based terminal emulator through which you can connect to your unix, linux box

You can download it from here for free


2) Xming X Server for Windows ( To be installed on local machine )

Again this is also based on open source , it’s a leading X Server for windows. You can download it from here for free

Configuring Xming Server

After you are done with Xming Server installation on your Win ( Win 7 in my case ) , we need to configure it by invoking Xlaunch from Xming Menu.

Here are some of the screenshots that shows you how to configure the Xming






Hit Save Configuration button & then Finish



Configuring Putty Client for Xming

Now we need to configure putty, assuming you already know your Unix/Linux Server hostname or ip address, here are the steps to configure Xming


Change the value for scrollback to a desired bigger no.


Make sure “Enabling X Forwarding is selected” with a value of localhost:0


Now go back to sessions option that appear on left and save this putty configuration

Now we just need to invoke Xming Server from Start Menu.

Go to Start Menu — > All Programs –>Xming —> Xming

This will bring Xming in taskbar next to windows clock


Take a connection through putty to your linux/Unix Server and after entering credentials type in xclock. It should come up like shown below



If you want to run xclock in the background, invoke following command

xclock &

instead of just


So far this works great, but what i observed was as soon as shifted to oracle user on unix it stopped working it gave me this error

[oracle@pr ~]$ xclock
Xlib: connection to “localhost:11.0” refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can’t open display: localhost:11.0
[oracle@pr ~]$

For this there is a workaround, hift back to root account and issue following command

xauth list


You might see just 1 line depending upon how many keys are present in xauth. In my case there are 3 keys

Copy the last line into clipboard

pr.localhosts.localdomain/unix:11  MIT-MAGIC-COOKIE-1  51da8af273156d606b3080213fae200d


Switch to Oracle account via su – oracle

and issue following command

xauth add pr.localhosts.localdomain/unix:11  MIT-MAGIC-COOKIE-1  51da8af273156d606b3080213fae200d

Basically i added key to xauth

and now you are all set and you wont get this error atleast in current session





Categories: Uncategorized Tags: , , , , , , , ,
  1. July 25, 2013 at 5:46 pm

    Good article. Two quick comments:
    1. You can also use cygwin (cygwin.com) instead of Xming. Both are open source, both look like they do an identical job on the X-Windows side. Cygwin also provides Unix tools like cat, more, awk, etc. which is why I prefer it.
    2. If you log in as Oracle instead of root, you don’t have to deal with the xauth stuff. And it’s a good habit to not log in directly as root anyway.


  2. February 23, 2017 at 7:22 am

    Thank you Neeraj (y)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: