Saturday, February 2, 2008

MATLAB Licence Management

For those that enjoy altering MATLAB licence files and/or working remotely, this may be of interest to you. Providing you have access to your workplace’s VPN server and that the IT department haven’t locked the network down, you may be able to run MATLAB remotely.

As described by MathWorks, your licence file header may contain a line in the form:

SERVER Licence_Server_Name HostID TCP_PortNumber

When using your (company/institution’s) computer remotely, you are likely going to be on a different domain name regardless of whether you are connected via VPN or not. Consequently, if you are having problems opening MATLAB despite using VPN in the hope it will connect to the licence server, you may wish to check your licence file header before assuming it’s a firewall/network configuration issue.

You can find the licence files (named “license.dat” - take note of the spelling) within your MATLAB directory ($MATLAB).

For Windows installations: $MATLAB\bin\win32\license.dat

For Unix installations: $MATLAB/etc/license.dat

Now, before one starts altering these licence files, consider backing up the original files.

Open the license.dat file within the text editor of your choice and check the form of the header as mentioned above. Should the Licence_Server_Name field not be of the form or but is instead stated as server, this will at least be partly, if not entirely, responsible for the licence issues you are having.

By simply stating the licence server as server, the local computer appends its local domain name and extension (as set by the network configuration) to the server name in the belief that the licence server is connected to your local network. By appending your workplace’s domain and domain extension (i.e. .com,, etc.) to the licence server name, the local computer will attempt to connect to the server under your workplace’s domain.

Once you have made changes to your licence file, save it, establish a connection through VPN and then fire up MATLAB. This should solve any issues where two or more networks try to connect to one licence server that is connected to only one of those networks (where each network has a different domain name).

Should this not have solved your problems, it’s possible that the IT department have either used IP filtering (to limit the range in IP addresses that connect to the server) or have invested in a firewall that blocks the port TCP_PortNumber.

So, in a nutshell (and for those that enjoy procedural steps):

  1. Backup your license.dat file
  2. Open your license.dat file in a text editor
  3. Ensure that a domain is indeed specified within the header where the header is in the following form:
    SERVER Licence_Server_Name HostID TCP_PortNumber
  4. If the Licence_Server_Name has a (valid) domain and extension, the problem appears to be caused by a firewall or IP filtering.
    If the Licence_Server_Name doesn’t have a domain and extension, add one (preferably your workplace domain and domain extension) such that the header now reads:
    SERVER Licence_Server_Name.Domain.Ext HostID TCP_PortNumber
  5. Save any changes made
  6. Establish a VPN connection, load MATLAB and await results
  7. If it is either hanging or you have receiving error messages about the licence manager, it’s possible that the domain and domain extension entered is incorrect. Otherwise, the IT department have a firewall or IP filter that’s blocking your licence request.

Another thing to bear in mind is that you should, in theory, keep your VPN connection open whilst you are using MATLAB. By doing so, any other licence requests can be sent to the licence server (such as checking out and checking in toolboxes) when required without causing any further grief. Hence, you should really only disconnect from VPN once MATLAB has closed.