Borrow Licenses

    Note   You can only use license borrowing with Concurrent licenses. This feature is not available for academic institutions.

License Borrowing Overview

To provide more license mobility, MathWorks® supports the FlexNet® license borrowing capability. With license borrowing, end users can use MathWorks products, for a specified time period, on computers that do not have a continuous connection to the license server. After end users borrow a license, they can disconnect their systems from the network and continue to use the products they checked out, until the borrow period expires. They can also return a borrowed license early.

    Note:   The procedures in this topic describe how to use the lmborrow utility or the LMTOOLS application for license borrowing. For information about using the license borrowing interface from within MATLAB®, see the Licensing Borrowing Interface guide on the MathWorks website.


Set Up License Borrowing: Administrator Tasks

To set up license borrowing, you, the Administrator on the license must:

  1. Enable license borrowing at your site — Request a License File from MathWorks that includes the borrowing capability. Use this License File to install the license manager on your license server, or replace the existing License File on your license server with this License File. For more information, see Enable License Borrowing.

  2. Use the License File with borrowing enabled on client systems — Make sure that you use the borrowing-enabled License Files on all client systems or that their License Files contain the USE_SERVER line.

Note the following limitations:

  • You can use license borrowing with Concurrent and Network Named User licenses.

  • The maximum borrow period is 30 days.

  • License borrowing is available with Release 14 or later and with license servers running FlexNet v9.2 or later.

  • MathWorks products must be installed on client systems (a configuration called local client access in the MathWorks installation documentation).

Use License Borrowing: the End-User Experience

With license borrowing, an end user on a client system can use MathWorks products for a specified time period on computers that do not have continuous connection to the license server. The following description provides a high-level view of how to use license borrowing.

    Note:   While performing these steps, the client system must have a network connection to the license server.

  1. Initiate license borrowing – End users run the lmborrow utility to specify how long they want to borrow licenses, called the borrow period. This initiates license borrowing on their systems. See Initiate License Borrowing.

  2. Borrow a license — To borrow a license, end users simply use MATLAB or any other MathWorks products. MATLAB checks out licenses for a product when they are first used. With license borrowing enabled, every license checkout borrows the license. You can also explicitly check out a license for a product using the license command.

  3. Turn off license borrowing — After borrowing all the licenses they want to use, end users should turn off license borrowing using the lmborrow utility. Otherwise, every time they use a MathWorks product, they borrow another license for that product.

After end users borrow licenses, they:

  1. Start MATLAB and any other MathWorks products that they plan to use during the borrow period.

  2. Disconnect their computer from the network.

    The next time they start MATLAB on their system, they will be using the borrowed license.

If end users finish using MATLAB before the borrow period expires, they can return the license. For information about returning a borrowed license early, see Return a Borrowed License Early.

Interoperability with Previous MATLAB Releases

MathWorks tries to preserve licensing backwards compatibility between releases. For example, you can run R2014a products with a R2014b License File.

Borrowed licenses are not compatible with Release 12 and earlier releases. You can run Release 13 products with a borrow-enabled license, however, using the borrowing capability is not supported.

The following table sums up the interoperability of different releases with license borrowing.

Release FamilyRun MATLABBorrow Licenses
R14 (and later)YesYes
R13YesNot supported
R12 (and earlier)NoNo

Enable License Borrowing

  1. Request a License File from MathWorks that includes the license borrowing capability. In these License Files, INCREMENT lines for products include the keyword BORROW=XXX, where XXX is the maximum number of hours the product can be borrowed. For example:

    INCREMENT MATLAB MLM 17 01-jan-0000 5 52FCH63184G5 BORROW=720 \
    DUP_GROUP=UH SN=220668

    To request a license, go to the MathWorks website and click Support. On the support page, click the Contact support link. For more information, see the installation documentation.

  2. On your license server, stop the license manager.

  3. On your license server, copy the SERVER and DAEMON lines from the existing License File, matlabroot/etc/license.dat, where matlabroot represents your MATLAB installation folder. For example, here are the SERVER and DAEMON lines from a License File:

    SERVER mysystem 0012110gbc86 27000
    DAEMON MLM C:\Program Files\MATLAB\R2014a\etc\win64\MLM.exe
  4. Paste the SERVER and DAEMON lines you copied from your existing License File at the top of your new License File.

  5. On your license server, replace the existing License File with the new License File.

  6. Restart the license manager.

Initiate License Borrowing

To initiate license borrowing, you can use the lmborrow utility or the LMTOOLS application.

Use lmborrow (Windows)

  1. Exit MATLAB, if you have it running. If you initiate license borrowing while MATLAB is running, you must restart MATLAB before you can borrow licenses.

  2. Open a DOS command window. One way to do this is to select the Run option from the Start menu, type cmd in the text entry field, and then click OK.

  3. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents your MATLAB installation folder and $ARCH represents a platform-specific folder.

  4. Run the lmutil command, specifying the lmborrow utility as an argument, as follows. (On Windows® systems, FlexNet packages all its license management utilities into one program, lmutil.)

    lmutil lmborrow MLM dd-mmm-yyyy [hh:mm]
    ArgumentDescription
    MLM

    Specifies the name of the MathWorks license manager vendor daemon.

    dd-mmm-yyyy [hh:mm]

    Specifies the end of the borrow period. Use three-letter abbreviations of the English month names, such as sep or oct. You can optionally specify the time [hh:mm] when the borrow period ends. If you do not specify the time, the borrow period lasts until midnight on the specified date.

Use LMTOOLS

    Note:   These instructions assume your system administrator copied the LMTOOLS executable file (lmtools.exe) into the matlabroot\etc\$ARCH folder on your system, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder. MathWorks Installer does not install LMTOOLS on client systems.

  1. Log in to your system and navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder.

  2. Start LMTOOLS by double-clicking the lmtools.exe file.

  3. Select the Borrowing tab in the LMTOOLS dialog box.

  4. Fill in the Return Date and Return Time fields and click the Set Borrow Expiration button. You specify the date in dd-mmm-yyyy format and optionally the return time hh:mm. Use the three-letter abbreviations of the English month names, such as sep or oct.

Turn Off License Borrowing

After you have borrowed licenses for the products you want to use, you should turn off license borrowing. Otherwise, with borrowing initiated, you might borrow licenses unintentionally. The following sections describe how to turn off license borrowing on Windows client systems and Linux® client systems.

Turn Off Borrowing on Windows Systems

Using the lmborrow utility.  

  1. Exit MATLAB.

  2. Open a DOS command window. One way to do this is to select the Run option from the Start menu, type cmd in the text entry field, and then click OK.

  3. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents your MATLAB installation folder and $ARCH represents a platform-specific folder.

  4. Run the lmutil utility, specifying lmborrow as an argument with the -clear option. (On Windows systems, FlexNet packages all of its license management utilities into one program, lmutil.)

    lmutil lmborrow -clear

Using the LMTOOLS Application.  

    Note:   These instructions assume your system administrator copied the LMTOOLS executable file (lmtools.exe) into the matlabroot\etc\$ARCH folder on your system, where matlabroot represents your MATLAB installation folder and $ARCH represents a platform-specific folder. The MathWorks Installer does not install LMTOOLS on client systems.

  1. Exit MATLAB.

  2. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents your MATLAB installation folder and $ARCH represents a platform-specific folder.

  3. Start LMTOOLS by double-clicking the lmtools.exe file.

  4. Select the Borrowing tab in the LMTOOLS dialog box.

  5. Click the Don't Borrow Anymore Today button.

Turn Off Borrowing on Linux Systems

  1. Exit MATLAB.

  2. Navigate to the matlabroot/etc/$ARCH folder, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder.

  3. Run the lmborrow utility, specifying the -clear flag.

    lmborrow -clear

Determine Which Licenses Are Currently Borrowed

Flexera Software, Inc, the makers of FlexNet, provides tools that you can use to monitor the status of borrowed licenses in your network configuration. You can use the LMTOOLS application or the lmstat command.

Monitor Borrowed Licenses with the LMTOOLS Application (Windows)

  1. Log in to your license server.

  2. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder.

  3. Start the LMTOOLS application by double-clicking the lmtools.exe executable file.

  4. Select the Server Status tab in the LMTOOLS dialog box.

  5. Click the Perform Status Enquiry button. LMTOOLS displays the status information in the output window. In the status information, each entry in the list for a product shows the total number of licenses for the product and tells how many licenses are currently checked out. For borrowed licenses, the entry for the product includes the keyword (linger:XXX), where XXX specifies the borrow period in seconds.

    -----------
    Status
    ------------
    Flexible License Manager status on Wed 7/6/2011 10:04
    [Detecting lmgrd processes...]
    License server status: 27000@myserver
    License file(s) on myserver: C:\Program Files\MATLAB\R2014a\etc\license.dat:
    
    myserver: license server UP (MASTER) v11.9
    
    Vendor daemon status (on myserver):
    MLM: UP v11.9
    Feature usage info:
    Users of TMW_Archive: (Uncounted, node-locked)
    Users of MATLAB: (Total of 5 licenses issued; Total of 1 license in use)
    "MATLAB" v14, vendor: MLM
    floating license
    myserver myserver (v14) (myserver/27000 101), start Tue 10/5 14:37
    (linger: 121500)
    Users of SIMULINK: (Total of 5 licenses issued; Total of 0 licenses in use)
    Users of Control_Toolbox: (Total of 5 licenses issued; Total of 1 license in use)
    "Control_Toolbox" v14, vendor: MLM
    floating license
    anyuser myserver myserver (v14) (myserver/27000 201), start Tue 10/5 14:37
    (linger: 121500)

Use the lmstat utility (Windows)

  1. Log in to your license server and open a DOS command window. One way to open the DOS command window is to select the Run option from the Start menu, type cmd in the text entry field, and then click OK.

  2. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder.

  3. Run the lmutil command specifying lmstat as an argument. (On Windows systems, FlexNet packages all its license management utilities into one program, lmutil.)

    The following example uses the -a option to display all the information returned by lmstat. Note that you must also use the -c option to specify the name of your License File. For more information about lmstat, see the FlexNet End User's Guide.

    lmutil lmstat -a -c "C:\Program Files\MATLAB\R2014a\etc\license.dat"

In the status information returned by lmstat, each entry in the list for a product shows the total number of licenses for the product and tells how many licenses are currently checked out. For borrowed licenses, the entry for the product includes the keyword (linger:XXX), where XXX specifies the borrow period in seconds.

lmutil - Copyright (c) 1989-2010 by Flexera Software, Inc. 
All Rights Reserved.

Flexible License Manager status on Wed 7/6/2011 10:04
[Detecting lmgrd processes...]
License server status: 27000@myserver
License file(s) on myserver: C:\Program Files\MATLAB\R2014a\etc\license.dat:
myserver: license server UP (MASTER) v11.99
Vendor daemon status (on myserver):
MLM: UP v11.9
Feature usage info:
Users of TMW_Archive: (Uncounted, node-locked)
Users of MATLAB: (Total of 5 licenses issued; Total of 1 license in use)
"MATLAB" v14, vendor: MLM
floating license
myserver myserver (v14) (myserver/27000 101), start Tue 10/5 14:37
(linger: 121500)
Users of SIMULINK: (Total of 5 licenses issued; Total of 0 licenses in use)
Users of Control_Toolbox: (Total of 5 licenses issued; Total of 1 license in use)
"Control_Toolbox" v14, vendor: MLM
floating license
anyuser myserver myserver (v14) (myserver/27000 201), start Tue 10/5 14:37
(linger: 121500)

    Note:   If the license status information contains entries for the MATLAB Compiler™, this does not necessarily mean that an end user has borrowed a license for this product. MATLAB Compiler itself uses the license borrowing capability. To determine if a user has borrowed a license for the MATLAB Compiler, check the expiration date specified in the listing and compare it to the expiration for licenses that you know an end user borrowed.

Use LMSTAT (Linux)

  1. Log in to your license server.

  2. Navigate to the matlabroot/etc directory, where matlabroot is your MATLAB installation folder.

  3. Run the lmstat utility.

    lmstat -a -c /usr/local/MATLAB/R2014a/etc/license.dat

Control License Borrowing with Options Files

You can control various aspects of license borrowing behavior using a FlexNet options file. An options file is a text file that contains option statements. Each option statement begins with a keyword that identifies the option. The following table lists the options you use to control aspects of license borrowing. For more information about these options, see the FlexNet End User's Guide. To see an example of an options file, see Example: Excluding a User.

TaskFlexNet Option to Use

Reserve a specific number of licenses that cannot be borrowed.

Use the BORROW_LOWWATER option.

For example, to make sure that three MATLAB licenses can never be borrowed, use this syntax:


BORROW_LOWWATER matlab 3

Specify which users can borrow licenses for a particular product.

Use the INCLUDE_BORROW option.

For example, to allow the user Fred to borrow a license for the Image Processing Toolbox™, use this syntax:


INCLUDE_BORROW image_toolbox USER fred

Note: When you specify that a particular user can borrow licenses, you exclude all other users.

Specify which users cannot borrow licenses for a particular product.

Use the EXCLUDE_BORROW option.

For example, to prevent the user Donna from borrowing a license for the Image Processing Toolbox, use this syntax:


EXCLUDE_BORROW image_toolbox USER donna

Specify the maximum amount of time a user can borrow a license.

Use the MAX_BORROW_HOURS option.

For example, to limit users of the Image Processing Toolbox to a three day borrow period, use this syntax:


MAX_BORROW_HOURS image_toolbox 72

The borrow period you specify must be less than 30 days, which is the borrow period specified in borrow-enabled licenses from MathWorks.

Example: Excluding a User

To illustrate using an options file to control license borrowing behavior, this example uses an options file to exclude a user from borrowing a license for a specific product:

  1. Create the options file.

    An options file is a text file that contains options statements. Using any text editor, create a file that contains the following line. You can give the options file any name and store it in any convenient folder.

    EXCLUDE_BORROW simulink USER fred
  2. Specify the name of the options file on the DAEMON line in your License File.

    On your license server, use any simple text editor to edit your License File, adding the options= keyword to the DAEMON line, as follows. Be sure to use the line continuation character (\) if the DAEMON line extends beyond a single line.

    DAEMON MLM C:\Program Files\MATLAB\R2014a\etc\win64\MLM.exe \
    options=C:\myborrowoptions.opt
  3. Start (or restart) the license manager so that it processes the options file.

After setting up this options file, test it by logging in as the user Fred. Start MATLAB and try to borrow a license for Simulink®. You can do this using the license command at the MATLAB prompt, as follows.

license checkout simulink

Your attempt to borrow a license for Simulink as the user Fred should fail, displaying the following message.

License Manager Error -38.
User/host on EXCLUDE list for feature
Feature: simulink
License path: C:\Program Files\MATLAB\bin\win64\license.dat;
C:\Program Files\MATLAB\bin\win64\*.lic

Return a Borrowed License Early

Return Borrowed Licenses on Windows Systems

  1. Reconnect the client system on which the license was borrowed to the network.

  2. Open a Command Prompt window. One way to do this is to select the Run option from the Start menu, type cmd in the text entry field, and then click OK.

  3. Navigate to the matlabroot\etc\$ARCH folder, where matlabroot represents the name of your MATLAB installation and $ARCH represents a platform-specific folder.

  4. Run the lmutil utility, specifying lmborrow as an argument with the -return option and the feature name of the product you want to return. You must also specify the full path of the License File on the client system, using the -c option. For example, to return a borrowed license for the Signal Processing Toolbox™, you can use this code. Note that, in this syntax, the feature name is case-sensitive.

    lmutil lmborrow -return -c "C:\Program Files\MATLAB\R2014b\etc\network.lic" Signal_Toolbox

Return Borrowed Licenses on Linux Systems

  1. Reconnect the system on which the license was borrowed to the network.

  2. Navigate to the matlabroot/etc/$ARCH folder, where matlabroot represents you installation folder and $ARCH represents a platform-specific folder.

  3. Run the lmborrow utility, specifying the -return flag along with the feature name of the product you want to return. You must also specify the full path of the License File on the client system, using the -c option. For example, to return a borrowed license for the Signal Processing Toolbox, use this code. Note that, in this syntax, the feature name is case sensitive.

    lmborrow -return -c /usr/local/MATLAB/R2014b/etc/network.lic Signal_Toolbox
Was this topic helpful?