VNC server setup:
-
Install the vncserver if not installed already on the server-side.
# up2date -i vncserverSet a password for the VNC server. To do this, log in as a normal user and run the command `vncpasswd` from a shell prompt.
# su - <user1> $ vncpasswd
Note: The VNC service will not start unless you have set a password.Edit the "/etc/sysconfig/vncservers" file as below replacing the user values with the actual usernames.
VNCSERVERS="1:<user1> 2:<user2>" # user1's VNC options VNCSERVERARGS[1]="-geoThe default desktop session in VNC is a very simple one, using the twm window manager. Edit the file "/home/username/.vnc/xstartup"metry 1024x768" # user2's VNC options VNCSERVERARGS[2]="-geo metry 1280x1024"
# chkconfig vncserver onStart the VNC server.
# service vncserver startOpen up the firewall ports - 5901 and 5902 on the server for clients to connect to.
VNC connections use TCP ports numbering from 5900, one for each display number, so for display 5 the TCP port would be 5905. Also, Java VNC viewers use ports numbering from 5800, again one for each display number.
VNC client setup:
-
Install vnc viewer on the client side if not installed already.
# up2date -i vncThe VNC server is identified by a hostname (or IP address) and a display number for the user as setup in the "/etc/sysconfig/vncservers" file. Connect to the VNC server via:
$ vncviewer [options] [hostname][:display#]It will then prompt for the vncpasswd as set up earlier for the corresponding user. `man vncviewer` for options and other details on using "-via" for securing connections.
Related Reading:
- sandip's blog
- Login or register to post comments
Comments
CONGRATULATIONS! THANK YOU! I was having considerable difficulty and your instructions were fantastic! Thank you! I am looking forward to reading the information on the VNC with SSH.
Igafa.