I wanted to run a GUI application (AIX) on a local cygwin XServer (Windows) but always got a XWin: client # rejected from IP address error message appearing in the log file (%cygwin_root%\tmp\XWin.log). I looked over the FAQ and user guides on cygwin's site but to no avail. Even googling wasn't really much help. Thankfully I stumbled upon the answer in a tangential link of interest about CoLinux.
How I got here
- Start X on Windows. I did this by running %cygwin_root%\usr\X11R6\bin\startxwin.bat.
- Connect to the remote box. I did this by running ssh -X -l userid ip_address_of_remote in a shell.
- Try to run xterm.
- Results in xterm Xt error: Can't open display:
- Okay tunnelling through ssh doesn't seem to be working (shrug who knows with AIX). Type export DISPLAY=ip_address_windows_box:0.0
- Try to run xterm.
Xlib: connection to "xx.x.xx.xxx:0.0" refused by server
Xlib: No protocol specified
xterm Xt error: Can't open display: xx.x.xx.xxx:0.0
Solution
The real issue was that access control is enabled on the cygwin XServer (windows box) by default and the remote client (on AIX) did not have authorization to access the XServer. I figured this out by googling about the -ac parm that I found in the CoLinux page. So, the solutions are either to 1) disable access control or 2) allow the remote AIX box access rights.
- To disable access control add the undocumented (AFAIK) parameter -ac to the XWin startup script.
- Open %cygwin_root%\usr\X11R6\bin\startxwin.bat
- Add -ac to the %RUN% XWin -multiwindow -clipboard -silent-dup-error line.
- To change access rights for the XServer use xhost.
- At a shell prompt type xhost INET:ip_address_or_host_name_of_remote
Piece of cake! Both solutions work but I think the xhost (#2) is probably the "right" way to go.
Thanks for the help
I have searched for hours to fix this problem. I wasn't able to connect to a critical app at work because of the "client # rejected from IP" error. The xhosh INET:IP returned an error for me, but running x -ac -multiwindow worked great on a Windows XP box. Thanks.
Thanks!
I was just trying to get this set up so I could log into my school's CS lab and this post saved me plenty of frustration; xhost worked great for me. Thanks!
thanks....and more information.
I tried adding -ac to the run command in startxwin.bat, startxwin.sh and startxdcmp.bat files, but nothing worked. That is probbably because I am using just 'startx' commandline to initiate xserver. I then added -ac to the defaultserverargs and it worked like cream!
thanks!