To provide license mobility, MathWorks® supports license borrowing.
This capability lets you use MathWorks products on computers that do not have a continuous connection to the license server.
After you borrow a license, you can disconnect your computer from the network and continue to use the products you have checked out until the borrow period expires.
You can also return a borrowed license early.
Commercial Concurrent and Network Named User licenses can use license borrowing.
The maximum borrow period is 30 days (720 hours).
MathWorks products must be installed on client computers where the borrowed license will be used.
Note
Campus-Wide licenses, including Concurrent licenses, cannot use license borrowing.
You must be an Administrator of the license to enable license borrowing.
Request that borrowing be enabled on your license from MathWorks. To request this change, go to the MathWorks website at https://www.mathworks.com and click Support. On the support page, click Contact support.
Notes
In license files with borrowing, the INCREMENT
lines for products
include the keyword BORROW=720
, where 720
is the
maximum number of hours in the borrow period (you cannot change this value). For example:
INCREMENT MATLAB MLM 17 01-jan-0000 5 52FCH63184G5 BORROW=720 \ DUP_GROUP=UH SN=220668
The maximum borrow period of 720 hours is equal to 30 days.
After your license is enabled for borrowing, you will download a new license file.
On your license server, stop the network license manager.
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\R2021a\etc\win64\MLM.exe
Paste the SERVER
and DAEMON
lines that you copied
from your existing license file at the top of the new license file that includes the license
borrowing capability.
On your license server, replace the existing license file with the new license file.
Restart the network license manager.
Note
Ensure that the client computer has a network connection to the license server.
To turn on the menu option for Borrow Products in the Licensing menu:
On the client computer, start MATLAB and enter this command:
matlab.internal.licensing.enableBorrowUI(true)
After you turn on the menu option for License Borrowing the first time, it remains available any time you start MATLAB.
Restart MATLAB.
Locate the Borrow Products option in the Licensing menu.
On the Home tab, in the Resources section, click Help.
Under Licensing, look for Borrow Products.
To turn off the menu option for Borrow Products in the Licensing menu:
On the client computer, start MATLAB and enter this command:
matlab.internal.licensing.enableBorrowUI(false)
To borrow licenses by product name:
Start MATLAB.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Borrow selected products by choosing from a list. The dialog box displays the products that can be borrowed.
Specify the borrow period: from 1 day (default) to 30 days.
Click the check box next to each product that you want to borrow.
Click Borrow.
Close MATLAB.
Disconnect your computer from the network.
When you reopen MATLAB, your borrowed keys can be used.
Continue using the borrowed products until the borrow period expires. If you reconnect to your network before the end of the borrowing period, see Return Borrowed Licenses Early.
To borrow product licenses automatically:
Start MATLAB.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Borrow products automatically as you work with them.
Specify the borrow period: from 1 day (default) to 30 days.
Click Turn On Borrowing.
Work in MATLAB as you would normally, performing the tasks you want to perform when you are disconnected from the network. As you use products, MATLAB borrows the licenses for them automatically. When you have borrowed licenses for all the products that you want to use, click Turn Off Borrowing.
Close MATLAB.
Disconnect your computer from the network.
When you reopen MATLAB, your borrowed keys can be used.
Continue using the borrowed products until the borrow period expires. If you reconnect to your network before the end of the borrowing period, see Return Borrowed Licenses Early in the next section.
To return a borrowed license early:
Connect your computer to your network.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Return borrowed products early. The dialog box displays a list of currently borrowed products.
Specify the product licenses you want to return early. By default, all borrowed product licenses are selected. Deselect any products you do not want to return.
Click Return.
Note
You cannot borrow licenses and then return them in the same MATLAB session. You must quit MATLAB and restart it before you can return the licenses.
Use an options file to control license borrowing behavior. Use the network license manager tools to monitor which licenses are borrowed.
The network licensing manager 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.
Use LMTOOLS Application on Windows Systems
Log in to your license server.
Navigate to the
folder, where matlabroot
\etc\win64
represents the name
of your MATLAB installation.matlabroot
Start the LMTOOLS application by double-clicking the lmtools.exe
executable file.
Select the Server Status tab in the LMTOOLS dialog box.
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 10/5/2016 10:04
[Detecting lmgrd processes...]
License server status: 27000@myserver
License file(s) on myserver: C:\Program Files\MATLAB\R2021a\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 Wed 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 Wed 10/5 14:37
(linger: 121500)
Note
MATLAB Compiler™: License status information may contain linger even when MATLAB Compiler is not being borrowed.
Use lmstat Utility on Windows Systems
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.
Navigate to the
folder, where matlabroot
\etc\$ARCH
represents the name
of your MATLAB installation and matlabroot
$ARCH
represents a platform-specific
folder.
Run the lmutil
command specifying lmstat
as an
argument. (On Windows® computers, 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\R2021a\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 10/5/2016 10:04
[Detecting lmgrd processes...]
License server status: 27000@myserver
License file(s) on myserver: C:\Program Files\MATLAB\R2021a\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 Wed 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 Wed 10/5 14:37
(linger: 121500)
Note
MATLAB Compiler: License status information may contain linger even when MATLAB Compiler is not being borrowed.
Use lmstat on Linux Systems
Log in to your license server.
Navigate to the
directory,
where matlabroot
/etcmatlabroot
is your MATLAB installation folder.
Run the lmstat
utility.
lmstat -a -c /usr/local/MATLAB/R2021a/etc/license.dat
You can control various aspects of license borrowing behavior using an options file for the network license manager. 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 the example in the next topic.
Task | Option to Specify |
---|---|
Reserve a specific number of licenses that cannot be borrowed. | Use the For example, to make sure that three MATLAB licenses can never be borrowed, use this syntax:
|
Specify which users can borrow licenses for a particular product. | Use the For example, to allow the user Fred to borrow a license for the Image Processing Toolbox™, use this syntax:
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 For example, to prevent the user Donna from borrowing a license for the Image Processing Toolbox, use this syntax:
|
Specify the maximum amount of time a user can borrow a license. | Use the For example, to limit users of the Image Processing Toolbox to a three day borrow period, use this syntax:
The borrow period you specify must be less than 30 days, which is the borrow period specified in borrow-enabled licenses from MathWorks. |
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:
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
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\R2021a\etc\win64\MLM.exe \
options=C:\myborrowoptions.opt
Start (or restart) the network license manager so that it processes the options file.
After setting up this options file, test it:
Log in as the user Fred.
Start MATLAB.
Use the Borrow Products menu to select Simulink® for borrowing.
You should get the following error:
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