SSH – Why Won’t X11 Display Work Through SSH Login?

cygwin;sshx11

I have logged in to a remote server and am trying to display an x application(e.g. firefox). but an error message appears. the below are my attempts to open firefox

Black@Black-PC ~
$ ssh -X kwagjj@$labserver -p 122
[kwagjj@James5 ~]$ firefox
Error: no display specified
[kwagjj@James5 ~]$ exit
logout
Connection to 143.248.146.204 closed.

Black@Black-PC ~
$ ssh -Y kwagjj@$labserver -p 122
[kwagjj@James5 ~]$ firefox
Error: no display specified
[kwagjj@James5 ~]$ 

I used -X, -Y because I read somewhere that these two options are related with credentials regarding X11 and these switches will do the job for me. Even without the -X, -Y switches, my attempt failed.

What does the 'no display speicified' error mean?

P.S. The weird thing is that if I connect to the remote server through my PUTTY and repeat the command 'firefox' it works?!?!(firefox is displayed on local computer)

P.S. my local computer is Windows 7 so I have Xming running on background in order to allow X11 display. As for the attempt written on the upper part, the commands were typed in at Cygwin terminal.

Best Answer

Make sure that you have the DISPLAY-variable set in your cygwin-environment:

export DISPLAY=:0.0

after connecting with SSH, check if that shell also knows the correct DISPLAY-variable with:

echo $DISPLAY
Related Question