From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041215 Firefox/1.0 Red Hat/1.0-12.EL4
Description of problem:
Scenario: Regular user is connected to a VNC server via vncviewer. The machine running the VNC server is in run level 3 (no X11). Next, within vnc session, user does an SU to root in an xterm and runs an X11 app, or runs an su graphical application (such as up2date, system-config-users, etc). Spawn of the X11 window then fails, with an "Xlib" connection xxx refused by server" error.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Server machine must be booted in run level 3, running RHEL 4.
2. User logs into a VNC session running on that server.
3. User runs root app such as up2date or system-config-users, etc.
4. Or, instead of 3, user does an su in an xterm, and runs an X11 app.
Actual Results: X11 app doesn't start. Instead, "Xlib: connection xxx refused by server error" occurs.
Expected Results: X11 app should have created a new window and run.
Problem doesn't occur if machine is booted into run level 5.
Problem occurs only when booted into run level 3.
Problem never occured in previous versions of vnc-server, such as 4.0-0.beta4.1.4
Problem doesn't occur if 4.0-8.1 version of Xvnc is replaced with 4.0-0.beta4.1.4
Problem seems to be due to improper handling of xauth/magic cookies within Xvnc.
I can't reproduce this. Please provide more information:
1. Have you modified your .vnc/xstartup file?
2. What does '/usr/sbin/getenforce' say?
3. How are you starting VNC? Running 'vncserver' from the command line or
editing /etc/sysconfig/vncservers (or some other method?)
1) $home/.vnc/xstartup slightly modified. Contents as follows:
# Uncomment the following two lines for normal desktop:
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
2) /usr/sbin/getenforce returns "Disabled"
3) VNC is started via: vncserver -geometry 1024x768 :66 (as regular user)
A) Using 4.0-0.beta4.1.4 /usr/bin/Xvnc works perfectly (no other files changed).
B) Using vnc-server-4.0-8.1 /usr/binXlib results in this error (after su, and
within an xterm, inside VNC session):
connection to "opus:66.0" refused by server
Xlib: No protocol specified
Warning: This program is an suid-root program or is being run by the root user.
C) My default Desktop is KDE, not gnome. vncserver inits KDE. NO idea if the
problem exists in gnome. I don't use twm, fvwm, etc.
D) Clean install of RHEL 4 WS on blank hard drive. Not upgraded from RHEL 3.
E) Machine boots into run level 3. Problem disappears in run level 5, or if I
do an "init 5" as root from level 3.
Typo in B), in my comment above. Should read:
B) Using vnc-server-4.0-8.1 /usr/bin/Xvnc results in this error.
I can't reproduce this.
Fresh install, with KDE added to the package list.
root: Adjust /etc/inittab so that runlevel 3 is default.
root: Add user 'foo'.
foo: Run vncserver -geometry 1024x768 :66
foo: vi .vnc/xstartup and uncomment two indicated lines
foo: vncserver -kill :66
foo: switchdesk KDE
foo: vncserver -geometry 1024x768 :66
Other machine: vncviewer rhel4:66
Main Menu->Run program->"xterm"
In xterm: "su"
Second xterm appears.