Department of Engineering

Offsite access to MATLAB License Server (Windows XP/Vista/Windows 7)

Note : This is only available for staff members, and postgraduates. Not available for any of the undergraduates. This is also not available for visitors.

This deals with installing additional MATLAB Toolboxes and accessing the MATLAB License server from Computers in College rooms and Home Computers (even if not connected to the Cambridge University Network). Requires the use of Broadband Internet connection.

Strictly for Members of the Cambridge University Engineering Department as it requires a valid User-iD and password.


Procedure

The steps involved are listed below :

  1. Establishing a connection to the CUED Computing system using secure shell.
  2. Obtain Matlab install DVDs from the Computer Operators (operators@eng).
  3. Installing MATLAB.

Only the Toolboxes for which there are 25 or more licenses are available through this download option (see the information on the University and Department licences, linked from Departmental MATLAB Information.)


1. Setting up a Secure Shell connection

The first stage of this process is establishing a connection to the Teaching System Computers using secure shell. You need down load PuTTY and start it. Enter gate.eng.cam.ac.uk for the Host Name.

In order save this give it a session name (for example) remote-matlab

Choose SSH and sub-option X11

Check the box marked Enable X11 forwarding and enter localhost for X-Display location.

Now choose sub-option Tunnels

Check the box marked Local ports accept connections from other hosts.

Next enter Source Port : 1711 and Destination : matlab-lmserv.eng.cam.ac.uk:1711 and click on Add. It would appear as

L1711 matlab-lmserv.eng.cam.ac.uk:1711

Now complete the rest of the input :

L1711  matlab-lmserv.eng.cam.ac.uk:1711
L20001 matlab-lmserv.eng.cam.ac.uk:20001

So it is displayed as follows :

If you make any mistakes, select the line and click on Remove, Make the necessary changes and click on Add. Select Session from Category menu on the Left Hand Side (LHS) of the PuTTY configuration window and click on Save to save the session.

Click on Open and this will give you a login window :

In subsequent sessions you need to load the saved session and login to the Teaching System Computers every time you want to use MATLAB.

Once you have established the SSH connection and logged into the gateway to the Teaching System Computers you can minimise the PuTTY window.


Obtain Matlab install DVDs from the Computer Operators (operators@eng).

For latest versions of MATLAB or for older versions please contact the Computer Operators (operators@eng).


Installing MATLAB

The next step is to install MATLAB.

License file : license.dat

Then use a text editor (notepad) to create a new file (license.dat) to have the following 2 lines :

SERVER localhost 0 1711
USE_SERVER

Now it is important to place the license.dat file where MATLAB is expecting it to be. Copy the file to :

C:\Program Files\MATLAB\R2010a\licenses\license.dat

If MATLAB is installed in a different directory or it is a different version make the necessary allowance in interpretting the above line.

If the license.dat file is not in the correct directory it will generate a flexlm error : -49.

MATLAB Installation Keys (along with the MATLAB License codes) requires the Raven password.

MATLAB License Codes.


Steps involved in running MATLAB after the Initial setup

Subsequent to the setting up, download and installation steps you need to follows only the steps listed below:

  1. Double click on PuTTy icon in the desktop and load the saved session and click on Open .
  2. Enter your Teaching System user-ID at the LOGIN prompt and follow it up with the password when prompted for it.
  3. Start up MATLAB.


Troubleshooting

  1. If the MATLAB banner appeared briefly and if you are using version 2007a or 2007b then follow the instructions given below :

    As a workaround, set the environment variable to MATLAB_RESERVE_LO=0 by performing these steps:

    1. In the Windows Control Panel -> select System -> Advanced -> "Environment Variables".
    2. In the *User variables for /your user name/* tab, click *New*.
    3. Enter the name MATLAB_RESERVE_LO and set the value to 0.
    4. click *OK* to save your changes and close the Control Panel.
    5. Log out from your Windows operating system, then log in. MATLAB

    The workaround effectively disables the memory reservation, which causes this problem.

  2. If you get a licensing error message then the ssh tunnels are not set up correctly (Action : check back all the previous steps for typos etc.) or there is alternative method to try. See below.

  3. If you get a Flexlm error like : -96, 147. If you get this and after checking the previous steps for any errors look at the matlab license files listed with the error message.

    Find the first license file and check the contents. If it lists the above 2 lines as suggested, then replace "matlab-lmserv" with "localhost" and save the file and start MATLAB again. If you get the same error then delete that license file (Then it would appear that it is not the license file MATLAB is accessing for validation). Move to the next one on the list and repeat the process until MATLAB works.

    Look in the following directory for the MATLAB License File :

    C:\Program Files\MATLAB\R20XXx\bin\winNN

    where Xx is the MATLAB version (examples : 10a 10b 11a) and NN is either 32 or 64.

    Examples :

    C:\Program Files\MATLAB\R2010b\bin\win32

    C:\Program Files\MATLAB\R2011a\bin\win64

    Other Possibilities :

    C:\Program Files\MATLAB\R2011a\licenses\network.lic

    If you have more than one version installed and if you cannot find the license.dat in the sub directory for the latest version look in the sub-directory for older versions. Find the oldest version of MATLAB and look in the ..\bin\win32 directory. To find the different versions installed in your computer

    START ---> My computer ---> C: drive --> Program Files ---> MATLAB

    and look at the folders listed. Alternatively on a command window type :

    dir C:\"Program Files"\MATLAB

    This will list all the versions that had been installed on the C drive. Last resort : Use the "search" command and search for the file "license.dat" Failing that search for "network.lic".

  4. Activation Key : There is no Activation Key associated with the Departmental networked licenses. During installation if you come across a dialog box which requires entering a MATLAB activation key look for alternate options at the top half of that form. There will two options (1) Using Internet (2) Manual. Toggle the manual option and continue. This will lead to another dialog box where it will ask for a license file (with an option to browse and select it). Leave this dialog box and create the 2 line license file and save it somewhere convenient (say Desktop) and then return tp the MATLAB Installation page and browse and select the license file.

    Start up MATLAB and if you get a flexlm error -96 then it is a matter of copying the license file to one of the directories (create it if it does not exist) MATLAB is looking to find the license file and trying one of the alternatives for the SERVER (matlab-lmserv, matlab-lmserv.eng.cam.ac.uk, localhost) in license.dat and network.lic files.

  5. When it comes to selecting the various TLBXs (during installation) there aren't any TLBXs listed to select (It is all grayed out). Check the directory to which the TLBXs have been downloaded/copied. The TLBXs should be in the same directory as the installer.

    This is only applicable if the installation is being done from CDs or directly from the Mathworks site. Only relevant for users who have a Mathworks account.


Report Problems

If you run into any problems email a description of it to : pc-support@eng.cam.ac.uk.

Include screen dumps (use the ALT/ Print Screen buttons) of any error messages. On a DOS Window type the command "netstat -a" and send the entries for the following ports : 1711 and 20001.

If the above port entries are missing from the list then review the SSH tunneling steps.


Last updated: 30 May 2013

  • © Cambridge University, Engineering Department, Trumpington Street, Cambridge CB2 1PZ, UK (map)
    Tel: +44 1223 332600, Fax: +44 1223 332662
    Information provided by web-editor