Vnc viewer:The connection closed unexpectedly

ani627 picture ani627 · Aug 5, 2013 · Viewed 19.2k times · Source

Vnc server is running on RHEL and I'm trying to access it from Windows-XP using vnc viewer.

When I try to connect to it using ip-address:2, I can connect to it.

However when I try to connect it using ip-address:4, I'm getting following message:

The connection closed unexpectedly. Do you wish to attempt to reconnect to ip-address:4.

Can anybody please help me to resolve above issue?

Answer

kkeller picture kkeller · Aug 9, 2013

A vnc server is running on a certain "display", that is the :0 :1 :2 ... at the end of the connection string. Obviously yours is running on display 2 (which is TCP port 5902). I would assume there is either no vnc display 4 and your viewer software is giving a slightly missleading error message, or there is something other than a vnc server running on display 4.