Dirtbag's Blog

A VNC server is already running as :10, but it isn't

[ link: vnc_server_running | tags: solaris vnc | updated: Fri, 17 Apr 2020 12:12:08 -0400 ]

I ran into a problem today where I was trying to start up a vncserver session on :10 and it just would not start. Read on for more info and the solution.

When I checked the logs, what I saw was:


Starting up the machine number 10
Cannot bind the socket to the display. Error:1 at /usr/bin/vncserver line 275.
A VNC server is already running as :10

but checking for processes running on 5910 and 5810 showed that none were listening:


[root@myserver]$ netstat -an | grep 5910
[root@myserver]$ netstat -an | grep 5810
[root@myserver]$

after some searching, I finally found this link that lead me to the answer.

There was another stray process that was listening at tcp port 6010 as shown below


[root@myserver]$ /usr/sbin/lsof -i tcp:6010
COMMAND   PID USER   FD   TYPE    DEVICE SIZE NODE NAME
sshd    19464 root    8u  IPv4 143749109       TCP localhost.localdomain:x11-ssh-offset (LISTEN)

All I had to do was kill that process 19464 and then the vncserver was able to start up correctly.

ADDENDUM I finally found out what was causing it. It was my own ssh sessions to the server with X11Forwarding enabled that were causing the conflicts. So the ultimate resolution to the problem was to add the following into the "/etc/ssh/sshd_config" file.

X11DisplayOffset 50

and restart the sshd.

-db

Like this article? Buy me a beer!