This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Tuesday, October 3, 2017

How to restart the VNC viewer session in Linux Server?

For Restarting the VNC viewer session in Linux Server, first login to the server with root user.

Check the session port no by using ps command

[root@testserver ~]# ps -ef | grep -i vnc

testuser 21118     1  0 11:28 ?        00:00:01 /usr/bin/Xvnc :2 -desktop testserver.test.com:2 (testuser) -auth /testuser1/local/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /testuser1/local/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pn
testuser 21124     1  0 11:28 ?        00:00:00 vncconfig -iconic
testuser 21156     1  0 11:28 ?        00:00:01 /usr/bin/Xvnc :3 -desktop testserver.test.com:3 (testuser) -auth /testuser1/local/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /testuser1/local/.vnc/passwd -rfbport 5903 -fp catalogue:/etc/X11/fontpath.d -pn
testuser 21162     1  0 11:28 ?        00:00:00 vncconfig -iconic
testuser 21199     1  0 11:28 ?        00:00:01 /usr/bin/Xvnc :5 -desktop testserver.test.com:5 (testuser) -auth /testuser1/local/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /testuser1/local/.vnc/passwd -rfbport 5905 -fp catalogue:/etc/X11/fontpath.d -pn
testuser 21226     1  0 11:28 ?        00:00:00 vncconfig -iconic
root     21840 21775  0 11:34 pts/3    00:00:00 grep -i vnc


Now switch to testuser & kill the vnc viewer session port. :2, :3, :5

[root@testserver ~]# su - testuser
-bash-4.1$ vncserver -kill :2
Killing Xvnc process ID 21118
-bash-4.1$ vncserver -kill :3
Killing Xvnc process ID 21156
-bash-4.1$ vncserver -kill :5
Killing Xvnc process ID 21199

Now start the vnc viewer session.

-bash-4.1$ vncserver :2
New 'testserver:2 (testuser1)' desktop is testserver:2

Starting applications specified in /testuser1/local/.vnc/xstartup
Log file is /testuser1/local/.vnc/testserver:2.log


-bash-4.1$ vncserver :3

New 'testserver:3 (testuser1)' desktop is testserver:3

Starting applications specified in /testuser1/local/.vnc/xstartup
Log file is /testuser1/local/.vnc/testserver:3.log

-bash-4.1$ vncserver :5

New 'testserver:5 (testuser1)' desktop is testserver:5

Starting applications specified in /testuser1/local/.vnc/xstartup
Log file is /testuser1/local/.vnc/testserver:5.log

-bash-4.1$ exit

hope it helps.

No comments:

Post a Comment