How do I run MATLAB in a virtualized environment?

176 views (last 30 days)
I would like to run MATLAB in a virtual machine, Docker container, or VDI. What options are available?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Jan 2024
Edited: MathWorks Support Team on 12 Jan 2024
Check License Option
Before virtualizing MATLAB, please review your License Offering in our Program Offering Guide to check that your License Offering permits the usage of virtual machines or environments.
Virtual Machine or VDI
To use MATLAB in a virtual machine or VDI, first confirm that your environment meets the MATLAB System Requirements:
To install MATLAB in a VM or VDI, refer to the MATLAB documentation:
Cloud and Containers
Docker images, Amazon AMIs, and Azure VMs are available on the MathWorks Reference Architecture GitHub page:
For additional cloud integrations, refer to Resources for Using MATLAB and Simulink in the Cloud
  2 Comments
Walter Roberson
Walter Roberson on 2 Sep 2022
You do not need to install MATLAB separately on the VM if there is some other route that gives access to the directory that MATLAB is installed in.
However, when the user is running MATLAB on the VM, the standard license test sequence is going to be followed. See https://www.mathworks.com/matlabcentral/answers/99147-where-can-i-find-matlab-license-files#answer_108494 for the location of license files for local licenses; see the links inside that post for information on network license search path.
In the case of individual licenses, the hardware information for the Virtual Machine is what is going to be searched for in the license files, not the hardware information for the host that is running the Virtual Machine. So for example the hostid associated with the virtual machine would be looked for.
Most virtual machines are not able to use a hostid that is the same as the hostid of the host operating system, as the hostid usually have physical meanings for communications purposes and communication would be blocked if you used the same hostid for virtual machine and the host itself. This usually means that a different license file would be used for running on the Virtual Machine instead of directly on the host.
If your license is a Student or Home license, then your license can only be activated against one hostid, and that would give you problems with trying to run in a Virtual Machine as well as directly on the host.
If you are using an Education license or a Standard (commercial) license, then you can activate against multiple hostid, so you could activate against the VM hostid and against the native host. That would use up two of your license slots even though it is the same physical hardware; getting around this is tricky and might require assistance from Mathworks.
Walter Roberson
Walter Roberson on 13 Apr 2023
Additionally, per the Software License Agreement, Home and Student licenses cannot use Virtual Machines.
That statement disagrees with the text of the license terms.
R2023a, fullfile(matlabroot, 'license_agreement.txt')
1. License Options
1.1. Individual License Option
(i) The Individual License Option provides for use of Programs by a single
Named User.
(ii) A Named User may install the Programs on up to four (4) different
Computers but may not use a Program on more than two (2) Computers
simultaneously, except that Student and Home Licenses are limited to a
single Computer.
1.8. Remote Desktop and Shared Desktop
This section applies to all License Options above.
(i) Remote Desktop: A Licensed User may remotely access Programs using the
Microsoft(r) Remote Desktop connection feature or similar technologies.
2.3. Student
(i) Student Licenses may be licensed by students enrolled in
degree-granting educational institutions, or primary and secondary schools,
or those participating in a continuing education program at a
degree-granting educational institution. A Licensee may use the Programs
only on a single physical (not virtual) Computer owned or leased by the
student.
2.4. Home
(ii) A Licensee of a Home License may use the Programs only on a single
physical (not virtual) Computer owned or leased by the Licensee.
Do sections 2.3(i) (Student) and 2.4(ii) (Home) prohibit the respective users from using virtual operating systems on physical computers they own ?? NO -- the barrier is against virtual ownership . In other words, you cannot use a Student or Home license on a cloud computer.
Within one owned physical computer, Students and Home users may use any number of operating systems and any number of virtual machines. And for further certainty, access rights are promised by section 1.8, since a technology such as Parallels is effectively "similar technologies".
You know what is not permitted by the license though? Using a Student or Home license on the "family" computer, or on a computer owned by a boyfriend / girlfriend. The computer must be owned (or leased) by the Student or Home user.

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!