Some windows not appearing when using VNC

General support questions including new installations
Post Reply
j3flight
Posts: 5
Joined: 2010/01/09 00:33:09

Some windows not appearing when using VNC

Post by j3flight » 2010/01/09 01:01:08

Hi all. Been using CentOS for a few releases now, but this is the first time with a problem I can't overcome...

I'm attempting to setup VNC in way that emulates our other OpenSUSE installs - where you can connect to servername:1 and be presented with a graphical login screen. From there, you login and have a full desktop session.

I followed some steps from this site (very easy):
http://blog.sumostyle.net/robg/?p=82&cpage=1#comment-72
... and it worked like a charm. I get the graphical login screen, I can login, I can open terminal, some apps, move windows around, no problem. But, here's the problem: SOME windows refuse to appear.

For example, if I try to open "Add/Remove Software", it first prompts me for the root password, but then all I get is a "busy" mouse cursor and an entry on the task bar at the bottom that says "Starting Add/Remove Software" for about 5 seconds and then it dies off. The same thing happens for "Software Updater" and for almost EVERY entry under the SYSTEM>ADMINISTRATION menu. Which, basically means I can't change any settings via the GUI, which is kind-of the point! =)

I can't find any logging that helps me diagnose this, the windows just never appear. The behavior is the same whether I login as a user or root from the login screen (but, obviously, the root user doesn't prompt me for the password prior to running the apps). I've tried lots of different tweaks on the configs mentioned in the link above, but nothing makes any difference.

Can anyone help here?
Thank you.

Edit: Version is CentOS 5.4 x86_64
I performed a yum update + reboot, no changes.

j3flight
Posts: 5
Joined: 2010/01/09 00:33:09

Re: Some windows not appearing when using VNC

Post by j3flight » 2010/01/09 01:12:33

Just for a bit of extra information...
I tried doing the same thing on CentOS 5.2 x86_64, and the same problem exists there too.

j3flight
Posts: 5
Joined: 2010/01/09 00:33:09

Re: Some windows not appearing when using VNC

Post by j3flight » 2010/01/11 14:36:55

Even more info:
I ran Xnest from the console and then started a gnome-session.
It was awful slow, but it behaved appropriately. All the windows that I was having problems with appeared just fine.

Here is the biggest clue I have so far:
I ran Xvnc from the command line using the same parameters I specified in the xinetd config (except for "-inetd"). When I open a window that fails, I see this:
AUDIT: Mon Jan 11 08:58:55 2010: 1589 Xvnc: client 22 rejected from IP 127.0.0.1

Can anyone explain that?

j3flight
Posts: 5
Joined: 2010/01/09 00:33:09

Re: Some windows not appearing when using VNC

Post by j3flight » 2010/01/12 05:22:12

SOLVED.

It wasn't a VNC problem, it was a DISPLAY variable / X permissions thing...

In the VNC sesion, the DISPLAY variable was localhost.localdomain:1.0. When these apps were launching, they attempted to create a new window on the :1 display, (probably with a new user environment, since these all need elevated permissions).

The basic xhost authentication was kicking them out... It could be solved temporarily by doing one of two things.
- Run "export DISPLAY=:1.0" in a shell within the VNC session. Then run the actual application command line from there (which stinks). Not sure why this worked, but it did.
...or...
- Run "xhost +localhost" from a shell in the VNC session. Then the apps can run normally from the System menu.

As a permanent fix, I put ?xhost +localhost? in /etc/profile. Is there a better way to accomplish this? I'm surprised I don't see more people complaining about this. It's a pretty ugly problem if you intend to do any admin work in the GUI remotely.

Hope it helps someone...

j3flight
Posts: 5
Joined: 2010/01/09 00:33:09

Re: Some windows not appearing when using VNC

Post by j3flight » 2010/01/13 19:58:43

Just in case someone references this thread in the future...
The slightly better approach to using xhost in /etc/profile is this:


if [ "$GDM_XSERVER_LOCATION" = "xdmcp" ]; then
xhost +localhost
fi


If you don't do the check for xdmcp, you can get an error message when logging in over SSH.

Post Reply