Connecting to a remote Linux machine

5,460

Solution 1

Check the port you are trying to connect to. When you start vnc4server it should tell you which display it is creating, eg:

jrt@tails:~$ vnc4server 

New 'tails:1 (jrt)' desktop is tails:1

Starting applications specified in /home/jrt/.vnc/xstartup
Log file is /home/jrt/.vnc/tails:1.log

So, I have X running already, therefore vnc4server has started a new X server, :1. By default VNC connects to port 5900 but in this case the VNC server will be listening on 5901.

On the linux machine, you could run the command:

netstat -atpn

and look for something along the lines of:

tcp6       0      0 [::]:5901               [::]:*                  LISTEN      2737/Xvnc4 

An alternative to VNC you might look at is FreeNX / nomachine.com.

Solution 2

The connection refused problem can be caused by a couple of things. The first things to check are...

1) You are connecting to the correct IP address and port (DNS suffixes don't always automatically get added to hostnames so worth checking you can resolve the hostname from command line, just try pinging it see what comes back)

2) Check the server (your remote ubuntu machine at work) is configured to accept connection without prompt as the default is to prompt the remote machine for permission (or at least it used to be so still worth checking)

Finally whoever told you UltraVN viewer can connect to a machine without a server on the remote machine is talking rubbish. It would be a massive security concern if you could just remote into any computer.

Share:
5,460
Daniel Ozean
Author by

Daniel Ozean

struct descriptionOf { int elligent_Developer; short list_of_proven_skills; long list_of_ambitions; long long int erest_in_various_technologies; double effort_in_achieving_skills_and_ambitions; float ing_innovator; char of_a_hands_on_doer; }goldenmean; Software Developer with work experience in areas of Video/Image processing and codecs,DSP and multimedia Systems,on DSP/Multicore processor architecures, for devices and applications in Consumer Electronics, Communications industry. Programming languages: C,C++,Matlab/Octave,Python,DSP or RISC assembly languages.

Updated on September 17, 2022

Comments

  • Daniel Ozean
    Daniel Ozean over 1 year

    I am trying to connect to a Ubuntu-10.04 Linux desktop at work place from my home computer(Vista) after connecting to office VPN. I have installed vnc4server package on that linux machine. Then I start vncserver manually at command line. When I try to connect to it from my home computer (Vista)using VNC viewer, it gives an error saying - Unable to connect to host. Connection refused(10061).

    What could be the reason, and how can I resolve this?

    2] I also have installed UltraVNC on my Home computer(Vista). I thought UltraVNC, infact does not need any server installed/running on the computer we are connecting to. Is it correct that using UltraVNC viewer, we can connect to remote machine(Linux/Windows) without any piece of S/W needed on that remote machine?

    (For me connecting using UltraVNC also gave error saying - "Failed to connect".)

    Any pointers to resolve these errors would help.

  • emgee
    emgee over 13 years
    +1 FreeNX. Way better user experience, and it tunnels over ssh by default.
  • Daniel Ozean
    Daniel Ozean over 13 years
    Indeed the port number i was using was the problem. Thanks for the soln.