Page 1 of 3 123 LastLast
Results 1 to 10 of 130

Thread: HOWTO: Reverse VNC

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    HOWTO: Reverse VNC

    Note: As of November 27, 2007 this does not work with the latest version of Ubuntu (Gutsy Gibbon 7.10), however, dazwin has provided a good workaround using xvncviewer in post #66.

    VNC is a great tool that can aid in training and troubleshooting, however, with many people running NAT routers (such as D-Link, Linksys, Netgear, etc.) it can be quite difficult to establish a connection.

    The problem is that these types of firewalls block unsolicited inbound traffic, preventing you from establishing a connection. Many times, the person requiring assistance does not have the technical expertise to configure "port forwarding" on the router, or they do not have access to the device.

    As long they can connect to the internet, they could establish a 'reverse VNC' connection to you --- allowing you to view their desktop. The only caveat is that if you are behind a NAT router or firewall, you must have configured 'port forwarding' on port 5500 to forward to your internal IP address.

    How To Setup Reverse VNC

    1. Make sure that you have setup any necessary port-forwarding on your router to forward TCP port 5500 to your internal IP address. You may want to consider using a static IP (or static DHCP), so that you always have the same internal IP address.

    I also use a dynamic DNS service so that I can just tell people to connect to myhost.dyndns.org, rather than having to tell them my external IP address.

    2. On the "remote" computer (the one that you want to control), you need to install the x11vnc package:
    Code:
    sudo apt-get install x11vnc
    3. Before the remote user can "send their desktop", you need to set vncviewer to listen-mode on your computer:
    Code:
    vncviewer -listen 0
    4. Lastly, the remote user needs to issue the following command:
    Code:
    x11vnc -connect your.external.ip.address:5500
    or
    Code:
    x11vnc -connect myhost.dyndns.org:5500
    Addendum:

    For those that really want to shield the remote user from the command line, you could create a file on the desktop called "Remote_help.sh" and enter the following:
    Code:
    #!/bin/bash
    x11vnc -connect myhost.dyndns.org:5500
    Don't forget to change the permissions to 'executable':
    Code:
    chmod 755 ~/Desktop/Remote_Help.sh
    Now, they just have to double-click the "Remote_Help.sh" file and select RUN.

    If your router is configured correctly, their desktop should appear automatically.

    Attached is a screenshot of my desktop showing 2 remote laptops (VNC:Tecra & VNC:Dapper) that have connected using this method.

    -Dave
    Attached Images Attached Images
    Last edited by dbott67; November 29th, 2007 at 04:00 PM. Reason: Added note about 7.10 & workaround

  2. #2
    Join Date
    Nov 2006
    Location
    North 'woods
    Beans
    26
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Reverse VNC

    Sweet. Thanks for the writeup. Hopefully this can help folks setup support with work or for grandma. This has saved me from a few long drives. After the initial setup on the remotes you now have a simple "click so and so and I'll fix it" system.

    This is a better solution than an MS centric solution and works just as well and is much more flexible.

    I'd add that you might setup the port forwarding so that you activate and deactivate it as needed instead of always being on. No sense having crackheads beating on your box. Either via the router controls if it is easy or by running VNC only when needed.

  3. #3
    Join Date
    Nov 2005
    Beans
    33

    Re: HOWTO: Reverse VNC

    thank you for guide

    but I have problem with this.

    24/11/2006 13:30:02 The VNC desktop is mywokstation:0
    PORT=5900
    24/11/2006 13:30:02 Making connection to client on host xxx.dyndns.org port 5500
    24/11/2006 13:30:02 connection failed: Connection refused
    24/11/2006 13:30:02 reverse_connect: xxx.dyndns.org:5500 failed

    any idea how to fix this, thanks.

  4. #4
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Reverse VNC

    A couple things to verify:

    1. Have you enabled 'port forwarding' on your router to the internal IP address of your computer?

    2. Are you running a software firewall on your computer (the one that's running 'vncviewer -listen')?

    Can you post the following information:

    - make & model of router
    - type of internet connection (DSL/cable/dialup)
    - scenario: i.e. a remote user running Ubuntu 6.06 wants to send his desktop to my computer (running Ubuntu 6.06). He is connected via cable modem; I am connected to the internet via DSL.

    A couple of other caveats:

    1. If the remote user is behing a corporate firewall, they may be able to block outbound traffic (my firewall at work blocks ALL outbound traffic unless the port is explicity opened). Most home cable/DSL routers only block unsolicited INBOUND traffic.

    2. Some ISPs block certain ports to prevent their end-users from hosting servers (such as ssh, ftp, telnet, smtp, www, etc.). They might be blocking the VNC ports (5500, 5800 & 5900).

    -Dave

  5. #5
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: HOWTO: Reverse VNC

    I guess the setup is similar with an XP box (the people I often help are windows users as opposed to Ubuntu). So say I have UltraVnC installed on the remote XP computer, how would that work?
    No longer participating......

  6. #6
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Reverse VNC

    Quote Originally Posted by Jose Catre-Vandis View Post
    I guess the setup is similar with an XP box (the people I often help are windows users as opposed to Ubuntu). So say I have UltraVnC installed on the remote XP computer, how would that work?
    It depends:

    1. The Single-Click Way

    UltraVNC has a 'firewall friendly' application called the 'Single-click' applet. The SC applet contains all of the information in a single, small file that can be run from any Windows PC --- without any additional software. If you go to the UVNC website, they provide you with the generic text; you just replace their text with your IP (or DynDNS address) and a few other pieces of information. Upload the file to their site & they will compile it into an executable that you can then host on a website (or e-mail to friends, etc.).

    All they have to do is double-click the file and it will try to establish a connection to your computer.

    2. The Other Way - Have Them Download & Install VNC

    The full VNC application has the ability to initiate it's own outbound connection (I'll refer specifically to UltraVNC in this case, but I'm sure it's quite similar for Tight, Real and other variants).

    With UVNC, you tell them to start the UVNC server and right-click the icon in the task bar and select 'ADD NEW CLIENT'. They need to add YOUR external IP address (or DynDNS host) and click OK.

    You need to be running 'vncviewer -listen' on your Linux computer. You would also need to forward port 5500 on your router to your internal IP address if you have a NAT firewall.

    -Dave
    Attached Images Attached Images

  7. #7
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: HOWTO: Reverse VNC

    Thanks, that's very helpful
    No longer participating......

  8. #8
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Reverse VNC

    Quote Originally Posted by widjajayd View Post
    thank you for guide

    but I have problem with this.

    24/11/2006 13:30:02 The VNC desktop is mywokstation:0
    PORT=5900
    24/11/2006 13:30:02 Making connection to client on host xxx.dyndns.org port 5500
    24/11/2006 13:30:02 connection failed: Connection refused
    24/11/2006 13:30:02 reverse_connect: xxx.dyndns.org:5500 failed

    any idea how to fix this, thanks.
    As a follow-up to this post, I just noticed that after installing Beryl/XGL I now get this error message when I try to connect. When I logout and select the 'Gnome' session, the problem goes away, so there may be an issue reverse-VNCing to a computer running Beryl/XGL/AIGLX.

    -Dave

  9. #9
    Join Date
    Nov 2005
    Location
    Taunton, England
    Beans
    931
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Reverse VNC

    i must say this is an awesome guide!

    i set up an account at dyndns.org, and my ip is now pointed to by going to choad.getmyip.com

    i am home for christmas right now, and will be changing the settigns again when i go back to uni... but that doesnt really matter i can change the settings from my end no problem, i just want to make sure my niece's new computer is set up correctly. right now i have

    Code:
    #!/bin/bash
    x11vnc -connect 192.168.0.5:5500
    on her computer. it was running over the lan perfectly. shall i just change that to

    Code:
    #!/bin/bash
    x11vnc -connect choad.getmyip.com:5500
    ???

    will that be all thats needed from her end?
    sudo make me a sandwich

  10. #10
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Reverse VNC

    Yep... that's it!

    Just make sure that if you're running a NAT firewall (or whatever) that you forward traffic on port 5500 to the internal IP address of your computer when you're at university.

    -Dave
    Last edited by dbott67; December 27th, 2006 at 03:30 PM.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •