setting X display using Putty and Xming

setting X display using Putty and Xming on Windows XP.

install putty:
create new session.
make sure SSH -> X11 ->
Enable X11 forwarding is checked
X display location have localhost:0 in it
save the connection.

install xming
start xming with XLaunch.exe (keep all defaults)

open ssh session with putty

make sure following in not commented, if it is then you (or root if you are not root) have to uncomment it.

/etc/ssh$ grep X11Forwarding sshd_config
X11Forwarding yes

run following

$ xclock

you should see a clock window poped up on your PC

to run in background run

$ xclock &

there are many gui applications, that you can run
I found mozilla on sparc here–


later on I find out similar x display product
have more native to windows ui then xming and might be faster, ites same as xming except compiled with visual c++.

and if you are doing sudo and trying to run X
1- use putty to login into the server as your user (It didnt work when I logged in server ‘a’ from putty then from server a I ssh -X in server ‘b’)
2- sodu – su otheruser

ssh jason@remote-server -X
jason $ echo $DISPLAY
jason $ su – oracle
oracle‘s Password:
oracle $ xterm
Xlib: connection to “localhost:10.0” refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xterm Xt error: Can’t open display: localhost:10.0


make sure your $DISPLAY is same user you logged in from putty, if not make it same
$export DISPLAY=localhost:10.0

here is what you do ( /usr/openwin/bin//xauth on solaris)

jason $ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Next, sudo/su to the other account and add the authorization key.
jason $ su – oracle
oracle $ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

and then $JAVA_HOME/bin/jconsole (or ui app you want to run)


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s