I installed tigervnc-server package in server.

[root@localhost ~]# rpm -qa tigervnc-server

Created a vnc user and created vncpasswd also for that user.

[root@localhost ~]# useradd vnc
[root@localhost ~]# vncpasswd vnc
[root@localhost ~]# 

In /etc/sysconfig/vncserver I changed these 2 lines

VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

After that I restarted the vncserver service

[root@localhost ~]# service vncserver restart
Shutting down VNC server: 2:vnc                            [  OK  ]
Starting VNC server: 2:vnc 
New 'localhost.localdomain:2 (vnc)' desktop is localhost.localdomain:2

Starting applications specified in /home/vnc/.vnc/xstartup
Log file is /home/vnc/.vnc/localhost.localdomain:2.log

                                                           [  OK  ]

Cleared iptables also.

[root@localhost ~]# iptables -F

While running vncviewer in client side I am getting this error

[root@client ~]# vncviewer

enter image description here

How to solve this error?

3 Answers 3


Your server is only listening on the loopback address localhost.localdomain:2. Try launching it with the server's IP address specified explicitly:

vncserver -interface [address]
  • 1
    Great... I just changed this line VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" to this VNCSERVERARGS[2]="-geometry 800x600" now it's working fine.
    – max
    Mar 12, 2013 at 13:25

Also you might want to try this option:

-localhost no

The command that works for me is:

vncserver -localhost no -geometry 800x600 -depth 24

The idea is to have vncserver listen on the network interface, rather than just the loopback interface (lo).

  • 1
    the only option which works for 1.7.0 tigervnc server Mar 28, 2018 at 9:13
  • 1
    This finally solved my problem. Jul 21, 2020 at 7:51

Try shutting down the server with this command "vncserver -kill :1" then start the viewer again, no need to reboot.

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.