cannot connect to X server

The server is OpenSuse 11.3, 64-bit. Client is Windows XP SP3 running Xming and putty. From the Windows XP client I get connected to the server just fine using putty (ssh, X11 forwarding enabled, logging in as root), but when I try to run konqueror, or any other graphical app, I get “cannot connect to X server”. This used to work, and I have no idea why it suddenly stopped working. Any help appreciated.

echo $DISPLAY
And ensure it is set.
Did you su to another user once connected?
Lews Therin

$DISPLAY is not set. I have never set it to anything. I did not “su” to another user.

Hey there,
Try setting DISPLAY=localhost:10.0
Also ensure X Forwarding is enable in the server you are connecting to in /etc/ssh/sshd_config
You might also try to have putty explicitly use the -X or -Y ssh connection option, as described at:
IT Resource Center forums - DISPLAY Variable & ssh -X
Lastly, try ruling Xming out of it and verify you can XForward okay by connecting with another Linux box - just to make sure it is all good. (I bet it is just the display variable not getting set correctly.)
Lews Therin

My suggestions:

  1. Do an MD5 checksum of your install media. It’s really easy and can be done even from your faulty install.
  2. Do an fschk of your hard disk. How old is it? Know that typical “consumer grade” hard drives are on the downside of life after about 2 years and can be expected to start failing anytime thereafter especially after about 3.5 years. If your hard drive supports SMART, get a SMART utility and read the errors your hard drive is reporting (run at least 5 passes).
  3. If an application crashes, even if the KDE debugger crashes, copy whatever is captured to a textfile and save, maybe post here. So, for instance simply saying that ktorrent crashed isn’t very useful.
  4. At the moment you seem to think that numerous apps fail within KDE, so I suspect one of the above first and only for the moment am not going to suggest an application trace (running the app within a debugger) but I think it would be useful to copy any errors off machine (eg pen drive), then if after another install the app crashes again compare the errors. If the errors are the same, it would tend to point to an installation or persistent hardware issue (like inadequate hardware). If the errors change or disappear, then it would probably point to something like hard drive issues.

HTH,
Tony

Hey Tony,

I know you are offering to help, which is awesome, but I think your heading down a wrong track here: Apps are not crashing - it is only that X forwarding is not working when connecting from a windows box running Xming - there is no reason for him to check his install media, nor do an fsck nor does his drive have anything to do with the issue he is seeing.

This is just a simple matter of getting X forwarding to work via putty + xming. It is either his display variable, an xauthority issue, or a putty config issue and nothing more.

Cheers,
Lews Therin

Again, up until very recently, this worked just fine. I tried rebooting the OpenSuse server, and I tried rebooting my Windows XP workstation, all to no effect. I did assign the DISPLAY variable as suggested. It made no difference. This is not a headless server, if that matters, and the monitor on the server works just fine. Nothing has changed in my environment. I don’t understand why it just suddenly stopped working.

If it was working previously, then indeed something (by definition) must have changed.
Can you connect and X forward from another Linux box? If not, then the issue may not be with Xming / Putty at all. If so, then it likely is. At least you would then have a better idea of which end to attack the problem from.
It may be a problem with your .Xauthority - maybe create a new one? Also see this post for a sample of trouble shooting:
Verbose diagnostics of X11 forwarding
Lews Therin

A thought I had about this - is it possible you’re trying to connect with an already open root X session on the server? Forgive me if I’m on the wrong track here…

Yeah, I see that now… Somehow I didn’t see it was connecting from a remote server and it is clear as day.

My Bad. No new thoughts.

Tony

How would I determine if that were the case?

  1. After reading this thread again, I suggest you review LewsTherinTelemon’s advice in last post. You mention that it is just graphical apps, so I wonder if the server settings

Log in to your server via ssh, and make sure /etc/ssh/sshd_config contains ‘X11Forwarding yes’

  1. Now, if you’ve done all that, then maybe xauth (xorg-x11-xauth package) is missing (as it was for this user):

Re: [opensuse] 11.3 and ssh X forwarding not working

  1. This thread may also be relevant to your situation:

11.3 64bit ssh -X fails

I also had the problem that I was able to get access to my PC via ssh, but wasn´t able to start any program.
Starting “konqueror &” for example I mostly got the error “cannot connect to xserver”.
The problem was solved after I activated the IPv6 protocol in the YaST menu \ Network \ global options.
It was deactivated due to some advise of our Admin who told me that this protocol is not used in out network.

Before I´ve discovered this I found out something really strange:
After refreshing the xorg-x11-xauth package I got the usual error. But after a restart I was able to start
all programs in that session. After another restart I got the error again.
When I did a shutdown instead of a restart after refreshing the package I always got the error…

hope this will help someone

Thank you! This help after long-long surfing of the internet )))