Thursday, August 11, 2016

.::: Enable VNC Server on Redhat, Rhel/Centos :::.

Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.

1. Install patch tigervnc-server
  # yum install tigervnc-server

2 If fail cause rpm. Install patch as
yum -y install bc.x86_64 binutils.x86_64 compat-libcap1.x86_64
yum -y install compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
yum -y install dbus-glib-devel.i686 elfutils-libelf-devel.x86_64
yum -y install elfutils.x86_64 firefox.x86_64 gcc-c++.x86_64 gcc.x86_64
yum -y install glibc-devel.i686 glibc-devel.x86_64 gtk2.i686
yum -y install hal-devel.i686 irqbalance.x86_64 ksh.x86_64
yum -y install libaio-devel.i686 libaio-devel.x86_64 libaio.i686
yum -y install libaio.x86_64 libgcc.x86_64 libibverbs.x86_64
yum -y install libstdc++-devel.x86_64 libXau.x86_64 libXau.i686
yum -y install libxcb.x86_64 libxcb.i686 libXtst.i686 libXtst.x86_64
yum -y install lsof.x86_64 make.x86_64 numactl-devel.i686
yum -y install numactl-devel.x86_64 openmotif.i686 openssh.x86_64
yum -y install openssh-askpass.x86_64 openssh-clients.x86_64
yum -y install openssh-server.x86_64 rsync.x86_64 sysstat.x86_64
yum -y install tcpdump.x86_64 unzip.x86_64 xorg-x11-proto-devel.noarch
yum -y install zip.x86_64

rpm -q bc.x86_64 binutils.x86_64 compat-libcap1.x86_64
rpm -q compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
rpm -q dbus-glib-devel.i686 elfutils-libelf-devel.x86_64
rpm -q elfutils.x86_64 firefox.x86_64 gcc-c++.x86_64 gcc.x86_64
rpm -q glibc-devel.i686 glibc-devel.x86_64 gtk2.i686
rpm -q hal-devel.i686 irqbalance.x86_64 ksh.x86_64
rpm -q libaio-devel.i686 libaio-devel.x86_64 libaio.i686
rpm -q libaio.x86_64 libgcc.x86_64 libibverbs.x86_64
rpm -q libstdc++-devel.x86_64 libXau.x86_64 libXau.i686
rpm -q libxcb.x86_64 libxcb.i686 libXtst.i686 libXtst.x86_64
rpm -q lsof.x86_64 make.x86_64 numactl-devel.i686
rpm -q numactl-devel.x86_64 openmotif.i686 openssh.x86_64
rpm -q openssh-askpass.x86_64 openssh-clients.x86_64
rpm -q openssh-server.x86_64 rsync.x86_64 sysstat.x86_64
rpm -q tcpdump.x86_64 unzip.x86_64 xorg-x11-proto-devel.noarch
rpm -q zip.x86_64

yum -y install binutils.x86_64 compat-libcap1.x86_64
yum -y install compat-libstdc++.i686 compat-libstdc++.x86_64
yum -y install gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64
yum -y install glibc-devel.i686 glibc-devel.x86_64 ksh
yum -y install libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64
yum -y install libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64
yum -y install libstdc++-devel.i686 libstdc++-devel.x86_64 lsof.x86_64
yum -y install make pciutils.x86_64 sysstat.x86_64 unzip.x86_64
yum -y install compat-libstdc++-33.x86_64 compat-libstdc++-33.i686
yum -y install gcc.x86_64 gcc-c++.x86_64 glibc.i686
yum -y install libaio.x86_64 libaio.i686 libaio-devel.x86_64 libaio-devel.i686
yum -y install libgcc.x86_64 libstdc++.i686
yum -y install libstdc++-devel.x86_64 libstdc++-devel.i686
yum -y install libXtst.i686 libXtst.x86_64 lynx.x86_64
yum -y install make nspr.i686 nss.i686 openmotif.i686 unzip.x86_64
yum -y install ftp.x86_64 man.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64
yum -y install nfs-utils.x86_64 tcpdump.x86_64 telnet.x86_64 vsftpd.x86_64 tigervnc-server


rpm -q  binutils.x86_64 compat-libcap1.x86_64
rpm -q  compat-libstdc++.i686 compat-libstdc++.x86_64
rpm -q  gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64
rpm -q  glibc-devel.i686 glibc-devel.x86_64 ksh
rpm -q  libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64
rpm -q  libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64
rpm -q  libstdc++-devel.i686 libstdc++-devel.x86_64 lsof.x86_64
rpm -q  make pciutils.x86_64 sysstat.x86_64 unzip.x86_64
rpm -q  compat-libstdc++-33.x86_64 compat-libstdc++-33.i686
rpm -q  gcc.x86_64 gcc-c++.x86_64 glibc.i686
rpm -q  libaio.x86_64 libaio.i686 libaio-devel.x86_64 libaio-devel.i686
rpm -q  libgcc.x86_64 libstdc++.i686
rpm -q  libstdc++-devel.x86_64 libstdc++-devel.i686
rpm -q  libXtst.i686 libXtst.x86_64 lynx.x86_64
rpm -q  make nspr.i686 nss.i686 openmotif.i686 unzip.x86_64
rpm -q  ftp.x86_64 man.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64
rpm -q  nfs-utils.x86_64 tcpdump.x86_64 telnet.x86_64 vsftpd.x86_64 tigervnc-server

3. Enable vncserver
# vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /root/.Xauthority

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

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/teguht:1.log


[root@teguht]# ps -ef |grep vnc
root      3326     1  0 16:27 pts/0    00:00:00 /usr/bin/Xvnc :1 -desktop teguht:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
root      3332  3331  0 16:27 pts/0    00:00:00 vncconfig -iconic
root      3494  3177  0 16:28 pts/0    00:00:00 grep vnc
[root@teguht]#

4. Configure vncservers

# vi /etc/sysconfig/vncservers

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

VNCSERVERS="1:root 2:teguht 3:ngce 4:oracle 5:samadmin"
VNCSERVERARGS[1]="-geometry 1280x800"
VNCSERVERARGS[2]="-geometry 1280x800"
VNCSERVERARGS[3]="-geometry 1280x800"
VNCSERVERARGS[4]="-geometry 1280x800"
VNCSERVERARGS[5]="-geometry 1280x800"

"/etc/sysconfig/vncservers" 20L, 776C written

4. Enable automatic startup vncserver
[root@teguht]# chkconfig vncserver on
[root@teguht]#
[root@teguht]# chkconfig --list |grep vnc
vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@teguht]#

5 Enable password If want another user want to acccess vnc
  # su - teguht
  $ vncpasswd
  Password:
   Verify:
   xauth:  creating new authority file /root/.Xauthority

   New 'teguht:2 (teguht)' desktop is teguht:2

   Creating default startup script /root/.vnc/xstartup
   Starting applications specified in /root/.vnc/xstartup
   Log file is /root/.vnc/teguht:2.log

6. Restart vncserver
  # service restart vncserver

7. test access vnc with user root ( ip_address:1)
8. test access vnc with user another(teguht)( ip_address:2)

No comments:

Post a Comment

Popular Posts