Getting Error with VNC: Session is already running

Awinash Goswami picture Awinash Goswami · Feb 27, 2015 · Viewed 25.2k times · Source

While starting VNC session in Solaris 10 I am getting below error:

vncserver :0

A VNC server is already running as :0

ps -ef | grep -i vnc

root 19790 15407 0 05:55:22 pts/3 0:00 grep -i vnc #

however there is no sessions running at :0. I am not very sure if somewhere we have to define :0 port or not.

Answer

user2056463 picture user2056463 · Sep 14, 2016

After a lot of efforts I found removing .vnc folder(inside $Home) resolves the issue. .VNC folder is created every time you run the vncserver. This folder has a file that has a process Id of vnc to kill. In case the vncserver process hangs and doesn't even shows in ps -ef command, remove the .vnc folder, after that vncserver will be able to create new .vnc folder and kill the existing process.