Skip to main content
Engineering LibreTexts

Setup pitunnel for VNC access

  • Page ID
    36703
  • Why the pitunnel through VNC? A collaborative workspace enhances learning.  

    Aim of this chapter:    setup VNC access through the pitunnel so that other class participants can login and use a graphical IDE or command-line editor.

    Register for the free or paid version of pitunnel.

    https://www.pitunnel.com

    Setup a pitunnel for VNC access to your RPi.

    clipboard_e80fb31a80df310a4930351a1f4195028.png

    From the “Installation” link in pitunnel you should get a command similar to this that starts with the curl command and ends with the ‘&’ character.

    Next you will have your RPi initiate at tunnel through the firewall.

    Go to custom tunnel as shown below.

     

    clipboard_ed1f4a961f2ff5ae38b202e316bda5ade.png

    The button above labeled “Create Custom Tunnel” sends the user to a new window for creating the custom tunnel using the command-line.

    See note below;

    clipboard_e3a2ae27e0d01e8faf290c087867be4fd.png

    clipboard_e0aadd36fbcc3c3b731f92a39bc641d58.png

    Port 5900 is used for VNC.

    For tunnel name use VNCtunnel.

    pitunnel --port=5900 --name=VNCtunnel

    Paste and run the command similar to the above that was produced for your RPi to initiate the tunnel through the firewall.

     

    clipboard_eee21ce4730b943ce3413e8207b8f9510.png

    Pressing Ctrl-C will stop this tunnel and return the command prompt.  If you wanted to keep it running but still need a command prompt then just open another terminal.

    Alternatively start the tunnel in the background using the following advanced Linux technique.

     

    clipboard_e94ca98d933b8d6140806d302bf4dd486.png

    Note: To get the command prompt back press enter twice.

     

    clipboard_ee95e5823d8d9278f9d0020eaf50973f3.png

    Under Custom Tunnels pick up the IP:port used for the VNC.

    In this example, pitunnel.com:54713

    Within the VNC client use the IP:port that you got from the pitunnel.

    clipboard_e05e679cd3e08c8f46f268cac192432e7.png

     

    Next, for temporarily sharing your pitunnel-VNC-desktop with collaborators change your password to binf.123 (or similar).

    Share the IP:port        pitunnel.com:54713

    Share the password     binf.123

    Share through email or chat window.

    -------------------------------------------------------

    After the collaboration is completed reset the password and turn off the pitunnel.

    If pitunnel is running in the foreground of the terminal then use Ctrl-C.  if it was started in the background you can reboot to turn off the pitunnel.

    What if you started pitunnel in the background but you do not want to reboot to turn off the pitunnel?

    Ask the instructor how to find and stop a running process in Linux.