Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was used to connect from A to a system B through vnc with ssh tunnel via C.

I do the following:

  1. In B I start the vncserver:

    vncserver
    

    and let's say I get the :12

  2. In A I open the ssh tunnel:

    ssh -v -C -L 5912:B:5912 user@C
    
  3. In A I start my vnc client:

    vinagre localhost:12
    

But this doesn't work anymore, because when I start vinagre in the terminal associated to my ssh-tunnel I get:

channel 3: open failed: connect failed: No route to host

I know that there have been some problem with the system last week, but I don't know what has changed (I am not the computer administrator), maybe the ip address have been changed but I have removed

~/.ssh/know_hosts

so to avoid problems. I would appreciate any help or hint


I have checked that self-vnc works, by running

vncviewer localhost:12

on system B


I have done some tests, and I have found out that if I try to tunnel and connect to a session open by another user (with another number, like :6) I can connect successfully: in the sense that of course I cannot log in because I don't have the correct password, but at least the vnc client prompts for a password, moreover I don't see any message 'no route to host'. What could that mean? It looks like this vnc thing is not working only on some ports, doesn't it?.


Apparently the system manager set the accessible vnc port range 5900--5910, but the vncserver was assigning me a port number far above this value.

share|improve this question

migrated from stackoverflow.com Jun 17 '13 at 20:30

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Just a quick update why your port falls outside that port range - When a vncserver is started, your assigned port number is 5900 + N, where N is the returned VNC server number. Example:

vncserver
New 'localhost:1' desktop is localhost:1

In that case your port will be 5901. In your example, your server is using 5912, which is outside of your port range.

share|improve this answer

There is a possibility that indeed VNC server assigns a high port number beyond the allows range in firewall, as the edited question and Byob's answer indicate.

However, there is still a possibility as it has occured to me that there is indeed a routing error somewhere like the routing tables of the host machine or the router maybe. There is a relevant conversation in Google groups:

The routing for the target workstation is different between the two systems (...). The fault (...) will be either on the router or on the workstation, and it will either be a fault of omission (you've lost a route in your routing table) or superimposition (you've added an incorrect route to the routing table).

Also make sure that B indeed is reachable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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