Pages

Saturday, December 7, 2013

How to configure vnc server on linux

How to configure vnc server on linux
 
This post will discuss about How to configure vnc server on linux completely. For this experiment, we will user rhel (redhat enterprise linux) 6.
Here are the steps to configure vnc server on rhel :
  1. Install tigervnc-server
    # yum install tigervnc-server
  2. Edit the "/etc/sysconfig/vncservers" file to configure the required displays. The following entries enable VNC for display numbers ":2" and ":3". Notice multiple "display:user" pairs are defined on a single line, but the arguments for each display are defined separately.
    VNCSERVERS="2:root 3:oracle"
    VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"
    VNCSERVERARGS[3]="-geometry 1280x1024"
  3. Set the VNC password for any users defined in the "/etc/sysconfig/vncservers" file.
    # vncpasswd
    Password:
    Verify:
    #
    # su - oracle
    $ vncpasswd
    Password:
    Verify:
    $ exit
    logout
    # 
    
  4. Enable the "vncserver" service for autostart and start the service.
    # chkconfig vncserver on
    # service vncserver start
  5. If your firewall is on, you must add this code in /etc/sysconfig/iptables
    -A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
    
  6. You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.
Once your VNC server is configured, you can connect to it from any VNC client. On Linux this will often be TigerVNC, installed using the following command.
# yum install tigervnc
To connect to a VNC server use the following command.
# vncviewer machine-name:port
# vncviewer maggie.localdomain:3
# vncviewer 192.168.0.4:3

No comments:

Post a Comment

Don't Forget To Join Our Community
×
Widget