Question

I'm setting up some new VNC servers. I already have this setup working with CentOS 6.3, although I'm not certain that this difference is the real problem.

One of the window managers I'm making available is fluxbox, but when I start it, I always get the following: Error: Couldn't connect to XServer. Here's my setup:

fluxbox: fluxbox-1.1.1-5.el6.x86_64
vnc    : tigervnc-server-1.1.0-5.el6_4.1.x86_64
OS     : CentOS 6.4

Note that I can start other window managers: Gnome, KDE, openbox, xfce4, etc.

I gutted my ~/.vnc/xstartup script so it only loads an xterm. Then, I tried running startfluxbox &, but still got the error. Obviously, VNC is working, since my xterm opened up OK. I can start firefox, another xterm or other app requiring X, and even fluxbox comes up, but it is worthless in its current state, since it is not connected to the X session.

What is fluxbox looking for? Are there some log files I can look at to give me some clues?

Thanks, David

Was it helpful?

Solution 2

OK, I think I've figured out the problem, so I'm answering my own question.

In VNC, I usually specify a display number. (Note, however, that the problem occurs even if vncserver uses the first available display number.) So, I start the vncserver as:

vncserver :17

This should create an X session where my $DISPLAY is set to :17.0, but in CentOS 6.4, the $DISPLAY is set to :17 instead. Apparently, unlike other window managers, fluxbox is unable to handle this inaccuracy. The problem, then, was that fluxbox was trying to connect to :17 and was unable to do so.

My solution, as suggested by someone answering a different problem, was to set $DISPLAY as part of the invocation of fluxbox. So, in my ~/.vnc/xstartup file, I have:

DISPLAY=$DISPLAY.0 startfluxbox &

Note that this may not work for other releases of CentOS, so you might wish to test the release of the box you are using before adding the DISPLAY=... setting to the command.

OTHER TIPS

CentOS/RHEL 6.4 and up have upgraded libX11 and Xorg.

The $DISPLAY var handling has changed in libX11.

This one in particular is described in this git commit:

http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=f92e754297ec5fdb81068b56a4435026666224fa

we run our fluxbox with this script in our vnc configs now:

/usr/bin/fluxbox -display "$DISPLAY.0"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top