Step 1: Install Required Packages
Now install few required packages for vnc-serverFor CentOS/RHEL 6: # yum groupinstall "Desktop"For CentOS/RHEL 5: # yum groupinstall "GNOME Desktop Environment"
# yum install pixman pixman-devel libXfont
Step 2: Install VNC Server
# yum install vnc-server
On CentOS/RHEL 6, you will see that tigervnc-server package will be installed.
Step 3: Create User for VNC
# useradd user1 # passwd user1 # useradd user2 # passwd user2Now set the vnc password for all accounts need to connect through vnc.
# su - user1 $ vncpasswd $ exit # su - user2 $ vncpasswd $ exit
Step 4: Configure VNC Server for Users
VNCSERVERS="1:user1 2:user2" VNCSERVERARGS[1]="-geometry 800x600" VNCSERVERARGS[2]="-geometry 1024x768"
Where VNCSERVERS is the list of users need to connect, VNCSERVERARGS defined the screen size. Like user1 have a 800×600 screen, and user2 have 1024×768 screen size on his client.
Now start vnc-server service using following command and check the output
# service vncserver start Starting VNC server: 1:user1 xauth: creating new authority file /home/user1/.Xauthority New 'svr1.tecadmin.net:1 (user1)' desktop is svr1.tecadmin.net:1 Creating default startup script /home/user1/.vnc/xstartup Starting applications specified in /home/user1/.vnc/xstartup Log file is /home/user1/.vnc/svr1.tecadmin.net:1.log 2:user2 xauth: creating new authority file /home/user2/.Xauthority New 'svr1.tecadmin.net:2 (user2)' desktop is svr1.tecadmin.net:2 Creating default startup script /home/user2/.vnc/xstartup Starting applications specified in /home/user2/.vnc/xstartup Log file is /home/user2/.vnc/svr1.tecadmin.net:2.logAs per above output, you can see that user1 desktop is available on :1 and user2 desktop is available on :2. We will use :1 to connect to user1 and :2 to connect to user2.
Step 5: Connect VNC Server using VNC Viewer
# vncviewer 192.168.1.11:1To access remote desktop on vnc-server from windows system, you must have vnc-viewer installed on your system. There are various vnc viewer available to use. Download any one and install on your system, for example:
TightVNC: http://www.tightvnc.com/download.php
RealVNC: https://www.realvnc.com/download/vnc/
TigerVNC: http://sourceforge.net/projects/tigervnc/files/tigervnc/
After installing vnc viewer connect to your system, In below example we are connected to user1 (:1).
Now enter vnc password of account assigned with vncpasswd command.
You are connected to x windows system of your Linux machine.
No comments:
Post a Comment