Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running CentOS5.6 and am attempting to configure VNC. I edited /etc/sysconfig/vncservers to read as follows:

VNCSERVERS="2:paul 3:sid"
VNCSERVERARGS[2]="-geometry 800x600"
VNCSERVERARGS[3]="-geometry 800x600"

When I try to start or stop vncserver, I receive the message

starting VNC server 2:paul [FAILED]

I created xstartup as follows:

exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

startx &
exec gnome-session &

What additional steps are required to successfully start vncserver and allow remote access to the GNOME desktop?

share|improve this question
up vote 1 down vote accepted

Maybe you have a problem with the init script. Login as paul or sid and start a separate VNC session with $ vncserver :2 or $ vncserver :3.

share|improve this answer
I logged in as both users and executed those commands. xauth: creating new authority file /home/sid/.Xauthority looks like default startup script was created and application started. Should I now be able to VNC with either user? – SidC Sep 29 '11 at 18:06
Sure, it would work. – quanta Sep 29 '11 at 18:09
So, I tried to VNC into the server's IP address from 2 separate systems. Both attempts were refused. Do I need to restart vncserver service for this to take effect? – SidC Sep 29 '11 at 18:14
No. Make sure that you connect to port 5902 or 5903. Are you running iptables? If so, open this ports. – quanta Sep 29 '11 at 18:20
So, I opened several ports in the 5900 series using iptables. I'm able to VNC but when I execute startx to start Gnome Desktop, I receive PAM Authentication failed, cannot start X server. – SidC Sep 29 '11 at 20:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.