• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Thursday, February 07, 2013

    Running multiple VNC server sessions for different users in Linux

    Q: How can I run multiple VNC server sessions on the same server at the same time by different users?

    Ans: Open the main config file and add all the users along with any of the id as shown below. So that the user will logon using that ID using vnc client.
    # vi /etc/sysconfig/vncservers
    VNCSERVERS="
    2:root 4:deepak "

    Once done save the config file and assign a vnc password to each user manually by logging into their account

    NOTE: Make sure you login to the users account for assigning them password or else the vncserver services would not run properly for all the users
    # su - deepak

    $ vncpasswd
    Password: [
    Give the password for VNC]
    Verify: [Retype the password for VNC]

    Restart the vncserver services
    # service vncserver restart
    Shutting down VNC server: 2:root 4:deepak                  
    [  OK  ]
    Starting VNC server: 2:root
    New 'server.example.com:2 (root)' desktop is server.example.com:2

    Starting applications specified in /root/.vnc/xstartup
    Log file is /root/.vnc/server.example.com:2.log

    4:deepak
    New 'server.example.com:4 (deepak)' desktop is  server.example.com:4

    Starting applications specified in /home/deepak/.vnc/xstartup
    Log file is /home/deepak/.vnc/server.example.com:4.log

                                                                [  OK  ]

    Now you can login to the Linux machine using VNC viewer client using the below syntax
    192.168.0.100:2 ==> for user root
    192.168.0.100:4 ==> for user deepak

    You can also login to the server using your browser. Type the following links for the same
    http://server-ip:5802 ==> for user root
    http://server-ip:5804 ==> for user deepak

    NOTE: As you can see the port no. when you are trying to access your machine through the browser. It defines the ID of the user which you have assigned in the configuration file.

    For example:
    2:root - 5802
    4:deepak - 5804


    Related Articles
    usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
    You'll have to kill the Xvnc process manually
    VNC configuration in Linux


    Follow the below links for more tutorials:

    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to configure Samba 4 Secondary Domain Controller
    How to secure Apache web server in Linux using password (.htaccess)
    How to register Red Hat Linux with RHN (Red Hat Network )
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    What is the difference between "su" and "su -" in Linux?
    What is kernel-PAE in Linux?
    What is swappiness and how do we change its value?
    How to log iptables messages in different log file
    What are the s and k scripts in the etc rcx.d directories
    How to check all the currently running services in Linux
    How to auto start service after reboot in Linux
    What is virtual memory, paging and swap space?

    1 comments:

    1. How can I display this two sessions 2 and 4 and 0 display (screen) two?
      I want display what on screen is.

      ReplyDelete