I'm trying to configure VNC server on my Ubuntu 19.04 desktop so that I can connect to it through my windows laptop over home wifi. I followed steps mentioned https://www.cyberciti.biz/faq/install-and-configure-tigervnc-server-on-ubuntu-18-04/

My firewall is inactive and I am unable to connect from my laptop. I tried to connect from local vnc viewer using and it connects.

But if I give local-lan-ip:5902 I see the error "unable to connect to socket:connection refused"

I'm really not a pro at configuring stuff on linux, can someone help me figure out the issue ?

1 Answer 1


I found the solution here. VNC was bound to local host and I had to bind it to lan interface I ran vncserver -localhost no and it worked.


  • I have used vncserver for years and years but never had trouble connecting until this morning after a change of IP address. And by gum for whatever reason, this was the fix!
    – dldnh
    Commented Jun 27, 2021 at 21:20
  • Didn't work for me.
    – John Smith
    Commented Nov 12, 2023 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .