User Tools

Site Tools


login:vnc:start

This is an old revision of the document!


Remote Access with VNC

Virtual Network Computing (VNC) is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical-screen updates back in the other direction, over a network.

With some minor setup, you can use VNC to access your EECS account from your home machine with access to all the software installed on EECS systems and your home directory.

The setup instructions below assume that you are connected to an EECS tech-supported Linux system via SSH. For undergrad users, this means you are connected to “red.eecs.yorku.ca” via SSH. For other users, this means you are connected to “indigo.eecs.yorku.ca”.

VNC Password Setup

The first time you use VNC, you need to setup a password which you will need to enter on your PC when you go to access your EECS VNC session. Use the vncpasswd command to set a password:

% vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

vncpasswd will ask for a password, then ask you to re-type it to verify it. It also gives you the option of setting a “view only” password which you don't need. The encrypted password will be written to the file ~/.vnc/passwd in your EECS account. You only need to do this the first time you're using VNC, or when you want to change your VNC password.

Since VNC is an older protocol, it limits maximum password length to 8 characters. Please ensure that you use a secure password, or someone may be able to gain unauthorized access to your account contents.

Check If a VNC Server Is Already Running

Check to make sure that you aren't running an existing VNC server using the vncserver command with the list option. Here we can see that an existing VNC server is not running:

% vncserver -list

TigerVNC server sessions:

X DISPLAY #	PROCESS ID

If a VNC server was already running, the output would look like this:

% vncserver -list

TigerVNC server sessions:

X DISPLAY #	PROCESS ID
:2		18734

If you want to start a VNC server, continue to the next step. If you've already started a VNC server, skip to the section “Connecting to Your VNC Server.

Starting a VNC Server

In order to start the VNC server, run the vncserver command:

red% vncserver

New 'red:2 (bob)' desktop is red:2

Starting applications specified in /eecs/home/bob/.vnc/xstartup
Log file is /cs/home/bob/.vnc/red:2.log

Here we can see that the VNC server has started on “red:2”. The “red” part is because the server is running on “red.eecs.yorku.ca”. The ”:2“ part is the VNC server port. You will need both the hostname and port number when connecting to the VNC server from your computer in the next step.

Connecting to Your VNC Server

From your local computer, you can now access the VNC server that you started. See the section “VNC Clients” for recommendations on VNC clients for a variety of platforms.

As an example, if you are using Mobaxterm under Windows, follow this procedure to connect to your VNC session:

  • Select “Sessions”
  • Select “New session”
  • Select “VNC”
  • Under “Remote hostname or IP address” enter “red.eecs.yorku.ca” if you an undergrad, or “indigo.eecs.yorku.ca” if you are anyone else.
  • Beside “Remote hostname or IP address”, you will see “Port”. If the port you were given above (red:2) is 2, then enter “5902”. If the port you're given was “10, then select “5910”.
  • Click “OK”.
  • You should see a dialog box that says: “Please enter your password for vncuser on red.eecs.yorku.ca”. Enter the password that you entered from “vncpasswd” above. Click “OK”.
  • You should now be connected to your VNC session.

Stopping VNC Server

If you don't take steps to stop a running VNC server, it will continue to run when you logout. This poses two major problems:

1) There are limited system resources available. If everyone were to run a VNC server and keep it running, our server will run out of memory, and CPU power and will operate slowly for everyone. 2) If you leave a VNC session running, you provide a mechanism for outside users to access your account.

Stopping the VNC server is actually very easy. There are two ways to stop the VNC server:

  • You can stop the VNC server by simply logging out! Either double click the “Logout” option on the desktop, and choose “Log Out”, or click the small arrow in the upper right hand corner of the screen, then select your name, then “Log Out”.
  • You can use the vncserver command with the list option to see the port number of your VNC instance, then use vncserver -kill <port number> (eg. vncserver -kill :2). Your VNC server will be stopped.

Users who consistently abuse the system by leaving VNC sessions open when they log out will have their account locked.

VNC Clients

VNC clients are available for a variety of platforms. For Windows, we recommend MobaXterm. Most Linux systems have RealVNC's “vncviewer” installed, or it can be installed easily. MacOS X has built-in support for VNC. Go to the Finder, hit CMD-K, then in the “Server Address” field enter “vnc:HOST:port”.

login/vnc/start.1578498720.txt.gz · Last modified: 2020/01/08 10:52 by jas