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 :
- Install tigervnc-server
# yum install tigervnc-server
- 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"
-
Set the VNC password for any users defined in the "/etc/sysconfig/vncservers" file.
# vncpasswd Password: Verify: # # su - oracle $ vncpasswd Password: Verify: $ exit logout #
-
Enable the "vncserver" service for autostart and start the service.
# chkconfig vncserver on # service vncserver start
- 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
- You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.
# yum install tigervnc
# vncviewer machine-name:port # vncviewer maggie.localdomain:3 # vncviewer 192.168.0.4:3
No comments:
Post a Comment