last day (14 days later) » 

7:12 AM
1
Q: cygwin help: Xlib: connection to "ip:0.0" refused by server

hetaoblogI followed cygwin user guide as below: http://x.cygwin.com/docs/ug/using-remote-apps.html on windows xp, i started Cygwin/X->XWin server, EXPORT DISPLAY=:0.0 ssh -Y user@ip i saw below warning Warning: No xauth data; using fake authentication data for X11 forwarding. after login, i typed...

 
Is "clientip" the Cygwin machine or the other one? (I have to ask because people sometimes get confused about the words "client" and "server" with X, thinking that the machine on their desk can't be the "server" - it is!)
 
the ""clientip:0.0" i'm referring to the windows xp machine where i install my cygwin and xserver software.
 
Can you run "xauth list" locally on the Cygwin machine?
 
i run the command but got nothing
 
what command line did you use to start Cygwin/X?
 
7:12 AM
i click 'start->programs->cygwinx->xwin server'; when i try to input 'startxwin', it said 'startxwin: Another X server instance is running on DISPLAY :0
: Resource temporarily unavailable'; i also tried startx and then do ssh -Y, but the result is the same.
 
The "add comment" thinks we're commenting too much.
 
hi, Alan,
thx for your help:)
 
OK, first of all, can you run any local cygwin commands that use the X display? Did it come with any of the demos like xlogo?
Just want to figure out if it works at all.
 
looks as if i'm not doing it right, when i type xclock or xlogo, it always said command not found
is 'start->programs->cygwinx->xwin server' the right way to start X?
 
all right, I'm not sure what cygwin comes with.
When you run that, does it create a window right away?
 
7:21 AM
it's more like a terminal
 
A terminal with a shell prompt?
 
when i input startx, it will open a bigger window
yes, the first step will open a terminal with a shell prompt
 
Are you running the ssh inside that terminal?
 
yes
 
And you did the "xauth list" there too, and it printed nothing but another shell prompt?
 
7:24 AM
wow, now after startx, and then run 'xauth list' from the shell, it will print something
mypcname/unix:1 MIT-MAGIC-COOKIE-1 388f2b8389de4263ce9e6b6ac41b2a06
mypcname:1 MIT-MAGIC-COOKIE-1 388f2b8389de4263ce9e6b6ac41b2a06
 
that's more like what I was hoping for.
but I see you got :1 instead of :0 that's a sign you have two Xservers running at the same time
anyway, after xauth list returns something, the ssh -Y should not complain so much
 
for 2 xservers, there're indeed 2 X icon on the rightbottom,
the 1st one is when i click the 'cygwin->xwinserver',
the 2nd one appears after i type startx
 
it seems like the startx command is working better. have you tried the ssh in the terminal created by startx?
 
yes, i tried, it still return the same error
bash-3.00$ xclock &
[1] 28490
bash-3.00$ Xlib: connection to "mywindowsip:0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: mywindowsip:0.0
 
did it also say "using fake authentication data" again
 
7:33 AM
yes
 
did that ssh client come with cygwin or is it installed separately?
 
i forgot...it was sometimes ago; but i should be either be cygwin or some package of cygwin when installing cygwin/x
 
Give it a try with -v added to the ssh command. ssh -v -Y user@host
that will print a bunch of stuff for us to study.
we'll be looking for any mention of X11 or xauth
 
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
that's all i can find with X
 
OK, that tells me something. At least you didn't get a "debug1: No xauth program."
well this is going to be a pain, but I need you to add another -v to generate even more debugging output.
 
7:49 AM
another -v?
ssh -v -v -Y user@host?
 
yeah, that's it
 
what are we looking for?
looks X11 or xauth are the same..
 
after the password was entered, something like debug2: x11_get_proto: xauth list :0.0 2>/dev/null
 
debug2: x11_get_proto: /usr/bin/xauth list :0.0 2>/dev/null
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: x11_get_proto: /usr/bin/xauth list :0.0 2>/dev/null
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0
debug2: client_session2_setup: id 0
debug2: fd 3 setting TCP_NODELAY
debug2: channel 0: request pty-req confirm 1
 
are you still in a terminal where "xauth list" is showing something?
 
7:56 AM
yes
if i run this on unix, it will display several items
i mean, after ssh to the unix host
 
yeah, but you need it to work on the cygwin side, that's where your ssh client is
 
just tried, it will list 2 items
 
I think it's strange that the DISPLAY on the unix side is cygwin:0.0 - have you been manually setting a DISPLAY variable?
 
in unix side?
or in cygwin before ssh?
in cygwin shell, $ echo $DISPLAY
:0.0
on unix side,
echo $DISPLAY
windowsxpip:0.0
 
It's weird because normally ssh creates DISPLAY variables starting with 10. And it should be localhost.
 
8:08 AM
do you mean unix side?
 
yeah, on the unix side within the ssh session
 
thx
 
that DISPLAY variable is trying to connect from the unix box to the cygwin X server without going through the ssh forwarding.
 
i've fixed it by your help
 
wha?
you had a manual DISPLAY setting somewhere overriding the one that ssh created?
 
8:10 AM
yes, sometime ago, i added export DISPLAY=mywindowsip:0.0 in my shell rc file
 
I really should have picked that out sooner
 
so this was executed everytime when i ssh to the shell
really thanks to you
for spending such a long time with me
 
I'll go back to the question page and put the official answer in
 
thx. I'm wondering how I can do something back to you?
 
no need, you were a good cooperative debugging partner, it was fun
 

last day (14 days later) »