VNC server with persistent desktop.

8:22 PM

Setup VNC desktop for multiple users with persistent desktop.

When we start VNC server on Linux box it automatically starts with the next available desktop. For example if I start the VNC server and its not running for any other user I will get desktop :1 and next user will get desktop :2 and so on. These desktop numbers are not persistent by default, so next time when I start the VNC server I may get a different desktop number.
When we have customers using VNC for multiple users (e.g. Cubic) and we need to make sure that each user has VNC access to the server with his own username, we need to configure VNC with persistent desktop. Otherwise whenever there is restart of vncserver service (post maintenance etc.) users will not be able to connect vncserver as their desktop number may have changed. We can configure VNC server to run on predefined desktop for specific user to avoid such issues.
Lets assume we need to configure VNC for user1, user2,user3 and user4:
Steps:
1.Set vnc password for each user otherwise vnc server for that particular user will not start. So login to vncserver with each user and set vnc password using 'vncpasswd' command:
[user1@localhost ~]$ vncpasswd
2.Now edit '/etc/sysconfig/vncservers' file and add following line at the end of the file:
VNCSERVERS="1:user1 2:user2 3:user3 4:user4"
3.Set VNC server to start automatically at the event of the server reboot.
chkconfig --level 35 vncserver on; chkconfig --list  vncserver
4.Now start the VNC server:
$/etc/init.d/vncserver start
5.Uncomment the following two lines for normal desktop in '/home/<username>/.vnc/xstartup' file and restart the vncserver.
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
 
$/etc/init.d/vncserver restart
Once the above configuration is done, all users will have their own desktop. If the server IP is 10.1.1.1 then user desktop would be:
Username
Desktop
User1 10.1.1.1:1
User2 10.1.1.1:2
User3 10.1.1.1:3
User4 10.1.1.1:4
So user1 will connect VNC server using his own desktop number with server IP address:

You Might Also Like

0 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results