Virtual Network Computing VNC on Linux

 
Virtual Network Computing (VNC).

Platform: Linux

Flavor: Red Hat 5.x and Cent OS 5.x

Configuration Steps in detail:

   1. Install VNC and VNC Server package on Cent OS 5 as a privilege user root. I did this using yum.                                         
    #yum –y install vnc vnc-server.
 

 
   2. Edit the /etc/sysconfig/vncservers file to add the users who has an authority running VNC servers. Add the following line as follows
VNCSERVERS=”N:USER”
Where N is the number of the display VNC server and USER is the username. Multiple VNC server display and users can be specified  by placing a white space in between them as follows                                                                                                           VNCSERVERS=”1:user1  2:user2  3:user3”
Display 0 cannot be used for VNC as it is already being used by X. X window system is used by VNC server so make sure X window is up and running.
   3. Now set password for each and every user specified in /etc/sysconfig/vncservers. VNC passwords are completely different than system passwords.
#vncpasswd
Password:
Verify:
It is a good practice if you set VNC password for each and every user by logging in to system as a respective username such as logged in as a user1    and then run vncpasswd command to set password. The reason behind this is as output of vncpasswd a hidden directory called .vnc is created in every     user’s home directory. If we run vncpasswd with user name as argument to it may create problem because~/ .vnc directory is created in users home directory but it is owned by user root.
   4. Start the service for VNC server.
#service vncserver start
   5. By default VNC server runs in a simple X window manager. For the full GNOME or KDE environment (whatever is set to default) edit username/.vnc/xstartup file in every users home directory and uncomment the following lines.                                                   unset  SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
and make sure the file has the execute bit set.
   6. Start VNC Server at boot time using following command.
#chkconfig vncserver on
   7. Now VNC is up and running. Now use vncviewer command from remote Linux machine in order to get proper VNC-based X session. If the remote system is Windows then used proper VNC client. Download them from the website www.realvnc.com.            $vncviewer <vnc server address>:N
 user1 ~$vncviewer vncserver-address:1
replace N with the number of the VNC-based X session where the VNC server is running.

Issues and tricks:

If you are connecting to VNC server from windows box and your VNC client is ultra VNC then you must have proper and common user name defined on VNC Server and on remote windows machine.

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options