0

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:

#!/bin/sh
unset SESSION_MANAGER
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?

SidC
  • 369
  • 3
  • 9
  • 23

1 Answers1

1

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.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • 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
  • What? You execute `startx` after VNC? Did you uncomment 2 lines `unset SESSION_MANAGER` and `exec /etc/X11/xinit/xinitrc` in `$HOME/.vnc/startup`? – quanta Sep 30 '11 at 00:42
  • I did uncomment those lines in xstartup. Changed the latter to exec /usr/bin/gnome-session and now just have a blank screen when I VNC. – SidC Sep 30 '11 at 16:45
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/1480/discussion-between-sidc-and-quanta) – SidC Sep 30 '11 at 16:48