Thursday, July 20, 2006

installing VNCserver for the first time

1) install vncserver rpm
2) edit /etc/sysconfig/vncservers for VNCSERVERS and VNCSERVERARGS constants
[root@sfunppdac29 root]
# vi /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <
http://www.uk.research.att.com/vnc/sshvnc.html>.
# VNCSERVERS="1:myusername"

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"

3) run vncserver for the first time
[root@sfunppdac29 .vnc]# vncserver

You will require a password to access your desktops.
Password: Verify: xauth: creating new authority file /root/.Xauthority
New 'sfunppdac29.test.com:1 (root)' desktop is sfunppdac29.test.com:1


Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/sfunppdac29.test.com:1.log

4) edit /root/.vnc/xstartup to use GNOME instead of twm
replace "twm &" with "exec gnome-session &"

5) Kill any existing VNC servers with "vncserver -kill :xxx" where xxx is the display number.

6) Start vncserver.
[root@sfunppdac29 root]# service vncserver start


7) check service is running
[root@sfunppdac29 root]# service vncserver status
Xvnc (pid 12035) is running...

8) check that the default ports are up and running
[root@sfunppdac29 .vnc]# netstat -na grep LISTEN
tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN


Thanks to Greg Breland:
http://faq.gotomyvnc.com/fom-serve/cache/56.html

No comments:

Feel free to drop me a line or ask me a question.