Mar 6, 2010

VNC Server Configuration

Package    :

Service : vncserver

Configuration : /root/.vnc/xstartup


1) Start the vncserver service
    # service vncserver start

2) Give the password to the vncserver access
    # vncpasswd

3) Then execute the command vncserver
    # vncserver

4)The output of the command is like this

    New 'roswell:1 (root)' desktop is roswell:1

    Starting applications specified in /root/.vnc/xstartup
    Log file is /root/.vnc/roswell:1.log

5) vim /etc/sysconfig/vncservers
       VNCSERVERS = "2:root"
       VNCSERVERGS[2] = "-gcometry 800*600"

6) GOTO the runlevel 5
    #startx

7) Then open the configuration file
    # vi /root/.vnc/xstartup

    #!/bin/sh

    # Uncomment the following two lines for normal desktop:
     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 &

        Save and exit

Notice that the last line is "startx &" as this command will launch Gnome upon login via VNCserver. If you are using a KDE desktop, the line "startkde &" should replace the last line.

Logging in, you will be presented with a Gnome or KDE desktop.


9) From the client connect by using the vncviewer (IP:1)(refer 5 point)

    eg: 151.8.99.25:1

No comments: