VNC sessions will not start if your account is over the disk quota.
Make Sure You Have the Software
The following software is required - it works on both Windows and macOS:
- Oracle's Java Runtime. The VNC software unfortunately does not appear to be compatible with other Java engines.
- TightVNC Java Viewer. Be sure you download the Java Viewer from that page, not the Windows version or anything else.
- Husky OnNet. Unless you are physically on campus, you will not be able to connect remotely to our Linux machines without Husky OnNet.
- Terminal emulator - you will need a terminal to run SSH. The Mac has one built-in - it's located at Applications -> Utilities -> Terminal. If you're using Windows, Download PuTTY.
Start a VNC Session
In the examples below, linux-lab-069.ece.uw.edu is being used (and the example user's NetID is nemo).
Open your terminal program and connect to one of the Linux Lab systems using SSH.
If you're not sure of the name of the machine to which you've connected, use the hostname command:
[nemo@linux-lab-069 ~]$ hostname linux-lab-069.ece.uw.edu
Set a VNC password by running vncpasswd at the command prompt. Note that VNC passwords must be 8 characters or less - if you type a longer password, everything after character eight is ignored. (Technically you don't need to set up a new VNC password if you've previously created one, but doing this each time ensures you remember what it is!)
Note that while you're typing your password on Linux, you will not see any feedback at all (no asterisks).
You can start a VNC session by using the vncserver command as follows:
[nemo@linux-lab-069 ~]$ vncserver -interface 127.0.0.1 New 'linux-lab-069.ece.uw.edu:2 (nemo)' desktop is linux-lab-069.ece.uw.edu:2 Starting applications specified in /homes/nemo/.vnc/xstartup Log file is /homes/nemo/.vnc/linux-lab-069.ece.uw.edu:2.logTo verify whether a VNC session is already running, use the "-list" argument:
[nemo@linux-lab-069 ~]$ vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID :2 11720
- Take note of the display number associated with the session. VNC ports start at 5900 - so when TigerVNC refers to "Display :2", the port number VNC maps to that display is 5900 + 2 = 5902. If it tells you the display is ":3", you'd need to use port 5903; and so on.
With your VNC session now running, you can now connect to that hostname and port number using TightVNC.
Connect using TightVNC Java Client
The ECE Linux Lab machines require you forward your VNC session over SSH, which is why we only support use of the TightVNC Java Viewer - that software can manage SSH forwarding automatically. Launch TightVNC's Java Viewer, then do the following:
- For "Remote Host", use either "localhost" or "127.0.0.1"
- For "Port", use the port number from steps 3 and 4 of the previous section (e.g. 5902 in this example)
- You must check the box "Use SSH tunneling"
- "SSH Server" must be the name of the server you started the VNC server on (linux-lab-069.ece.uw.edu in this example)
- "SSH Port" must be "22"
- "SSH User" is your NetID - if you leave this blank, you will be asked for it right after the next step
- Once you've filled in all the fields, hit the "Connect" button
After pressing the Connect button, you will be asked for two passwords. First, you will need to provide your UW NetID password. The next prompt will ask for the VNC password you chose when you set up the VNC session.
There may be somewhat of a delay, but after all this you should soon see a new VNC window containing a Linux desktop session. If you see a blank window, be patient for a bit - but if it continues to be blank, end the current session and try starting over again using a different Linux Lab machine - the one you chose may already be bogged down with too many other users.
IMPORTANT: Close Your VNC Session When Finished!
From the command line on the remote machine, use the vncserver -list command to determine the display number of your VNC session. Then, run vncserver -kill to quit any sessions which need not remain open (note that you do not add 5900 in this case - use the exact display number reported).
[nemo@linux-lab-069 ~]$ vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID :2 11720 [nemo@linux-lab-069 ~]$ vncserver -kill :2 Killing Xvnc process ID 11720
If You Need to Reset Your VNC Session Password
Close any VNC sessions as in the previous section, then delete the
~/.vnc directory. This will wipe out any saved password for the VNC session:
[nemo@linux-lab-069 ~]$ cd [nemo@linux-lab-069 ~]$ pwd /homes/nemo [nemo@linux-lab-069 ~]$ rm .vnc/passwd
And to be really sure nothing is running...
[nemo@linux-lab-069 ~]$ pkill -u $USER Xvnc
Then, return to the top of the page to start a new server.
Note: things will be more complicated if you have started VNC server sessions on multiple hosts. The easy way to avoid this problem is to not do that.
Appendix 1: Connecting Using a Different Client
ECE Computing does not offer support for this. We provide this information for those adventurous and/or foolhardy enough to venture out on their own. It is published under the "you break it, you get to keep both pieces" license.
Most VNC clients other than the TightVNC Java Viewer do not have the ability to set up an SSH tunnel. If you choose to use something else, you'll need to manually set up an SSH tunnel separately - and will need to do it before launching your VNC session.
If your personal computer is running Linux or macOS, you can set up SSH tunneling from the command line using a command something like the following (as before, you'll need to replace nemo with your own NetID, and 5902 with the port number from that startvnc told you):
mylaptop$ ssh email@example.com -L 5902:localhost:5902
Once you've successfully set up the SSH tunnel, you can then connect your VNC viewer to
localhost on the selected port (5902 or whatever).