Connecting to a Campus System via VNC (macOS)

Overview

This tutorial is for members of Science seeking to establish a VNC connection to a campus PC/server without having VPN access.

Audience

This tutorial is written for:

  • Members of the Faculty of Science (faculty/staff/student)
  • Those comfortable with computers and installing/configuring software

Prerequisites

To complete this tutorial, you must:

  • Have a PC or server on campus that is already configured for VNC connections (including having a VNC server enabled and the correct firewall ports open)
  • Know the hostname or IP address of the PC or server on campus to which you wish to connect
  • Have requested and been approved for access to gate.sci.uwo.ca
  • Be running macOS Catalina (10.15) or higher
  • Have Java installed (instructions for macOS Catalina here)

Tutorial  (Method 1: using TightVNC software)

  1. Download and run the latest version of the TighTVNC Java Viewer (a .zip file).
    TightVNC download
  2. Open the folder to which you saved the file in Finder and double-click the downloaded .zip file to extract its contents.
    Extracting TightVNC Viewer
  3. Expand the extracted folder and double-click the tightvnc-jviewer.jar file.
    Launching TightVNC Viewer
  4. If you receive a warning that the application originates from an unidentified developer, click OK.
    Unidentified developer warning
  5. Press F4 to open the Launchpad.  Search for preferences and click the icon to open System Preferences.
    System Preferences in the Launchpad
  6. Click Security & Privacy.
    Security and Privacy Settingsr
  7. On the General tab, click the Open Anyway button.
    Launching TightVNC Viewer
  8. When prompted, enter your username and password for your computer and click Modify Settings.
    Authorizing the launch
  9. Click Open to launch the program.
    Launching TightVNC Viewer
  10. If prompted for access to a folder, click OK.
    Granting Folder Access
  11. Populate the following fields, replacing mypc.uwo.ca with the hostname of the PC or server on campus to which you wish to connect
    Remote Host mypc.uwo.ca
    Port 5900
    Use SSH tunneling Checked
    SSH Server gate.sci.uwo.ca
    SSH Port 22
    SSH User Your Western username

    The example above assumes you have a PC on campus named mypc.uwo.ca that is listening on the default VNC port of 5900.  If your VNC server is listening on a different display, you will need to modify this port number accordingly.  For example, to connect to display :1, you would choose port 5901.

    Click Connect.

    Establishing a VNC Connection
  12. If you receive a host verification warning, click Yes.  This is normal and expected when connecting to a host via SSH for the first time.
    Host Verification Warning
  13. When prompted, enter your Western password to establish the SSH tunnel.
    SSH Authentication
  14. When prompted, enter the VNC password that you configured on your campus PC or server and click OK.
    VNC Authentication
  15. You should now be connected to the remote system via VNC. 
  16. When you are finished with your session, simply close the TightVNC Viewer.

Tutorial  (Method 2: using VNC built-in to MacOS)

VNC has been built-in to MacOS since version 10.4, so you can also use that option.  

  1. Press F4 to open the Launchpad.  Search for terminal and click the icon to launch the application.
    Terminal icon in the Launchpad
  2. Execute the following command to establish an SSH tunnel, replacing mypc.uwo.ca with the hostname of the PC/Mac or server on campus to which you wish to connect, and username with your Western username.

    ssh -L 9001:mypc.uwo.ca:5900 username@gate.sci.uwo.ca

    The example above assumes you have a PC on campus named mypc.uwo.ca that is listening on the default VNC port of 5900. If your VNC server is listening on a different display, you will need to modify this port number accordingly.  For example, to connect to display :1, you would choose port 5901.   To connect to this host, you will thenconnect to port 9001 on your home mac computer once the tunnel is established.

    Establishing an SSH tunnel
  3. If you receive a warning about the authenticity of the host, type yes and press Enter.  This is normal and expected when first connecting via SSH to a host.
  4. When prompted, enter your Western password.  Note that you will not be able to see what you are typing when entering your password.
    SSH authentication
  5. Once logged in, leave the Terminal window open. SSH connection established
  6. From your (home) mac desktop, go to the menubar and pull-down the "Go" menu and select "Connect to Server...  K"
  7. In the pop-up window you would enter "vnc://localhost:9001" into the server field.   (you may also want to save this to the list of favourites for future use)
    VNC Connect Window
  8. When prompted, enter the VNC password that you configured on your campus Mac/PC or server and click OK.
    VNC Password Window
  9.  You should now be connected to the remote system via VNC.   (If your remote system is screen-locked you will need to enter your ID+Password to unlock it:

  10. When you are finished you can close the "Screen Sharing" window, and then logout of gate.sci.uwo.ca
    ssh exit command

Setting up VNC server on your Mac

To enable VNC logins on your mac -- that is, so you can use VNC to remotely login to your office Mac -- Open up System Settings on your mac and search for Sharing
Mac System Settings window

Enable Screen Sharing, then click the "I" icon on the right

In the Pop -up window set your VNC connection password. You can also choose who to allow access to -- in this example it is restricted to users who are also members of the Administrators group on the host Mac
Mac Screen Sharing window