2

I'm on CentOS 7 with TigerVNC installed. I have started it up (I think), but I can't connect to it.

Here's what leads me to think it's running:

$ vncserver -list

TigerVNC server sessions:

X DISPLAY #   PROCESS ID
:1            29811

But netstat doesn't list it anywhere:

$ netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      957/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1277/master
tcp6       0      0 :::22                   :::*                    LISTEN      957/sshd

Not sure if it's relevant or not, but here are my iptables:

$ iptables nvL
Chain INPUT (policy ACCEPT 6112 packets, 538K bytes)
 pkts bytes target     prot opt in     out     source               destination
    6   304 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:5901

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 810 packets, 156K bytes)
 pkts bytes target     prot opt in     out     source               destination

(I attempted to add a rule for 5901 thinking that maybe it was related to why I didn't see vncserver in netstat, but after changing that rule and starting vncserver, nothing changed as far as I can tell.)

2

vncserver -list only looks at files in ~/.vnc/. There should be a file in your ~/.vnc/ directory ending with .pid. Make sure that the numeric PID in that file (29811) is actually a running process. It is quite possible that the Xvnc process is not running, but exited in such a way that it didn't clean up the .pid file. You can also clean it up by running vncserver -kill :1. This will clean up any other socket files that might be remaining.

  • Thanks! You were right - the process wasn't actually running. I killed it with vncserver -kill :1 and then started it again with vncserver and this time around, it showed up in netstat -tpln (on port 5901) and I was able to connect. – ArtOfWarfare Sep 30 '15 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.