MATLAB Answers

Why do I receive License Manager Error -9?

29,606 views (last 30 days)
When I try to launch MATLAB, I get the following error:
License checkout failed. Invalid host. License Manager Error -9

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 May 2020 at 4:00
Edited: MathWorks Support Team on 14 May 2020 at 15:46
The best way to resolve a License Manager Error -9 is by reactivating MATLAB with the activation client.
Windows
The activation client is located here:
C:\Program Files\MATLAB\R20XXx\bin\winXX\activate_matlab.exe
Mac
  • Open Finder.
  • Go to "Applications".
  • Right-click or control-click on the MATLAB application icon. (e.g. MATLAB_R2015b.app)
  • Click on "Show Package Contents".
  • Open "Activate.app".
Linux
The activation client is located here:
/usr/local/MATLAB/R20XXx/bin/activate_matlab.sh
Once you have launched the MATLAB activation client:
  1. Select "Activate automatically using the internet."
  2. Log into your MathWorks account.
  3. Select the correct license.
  4. The username field should auto-populate with the correct user name. Leave it as is.
  5. Confirm the activation information.
  6. Click "finish" to complete the activation process.
  7. Restart MATLAB.
Still seeing a License Manager Error -9?
  • The username in the license file does not match
  • The Host ID in the license file does not match
  • You have a Designated Computer MATLAB license and MATLAB is already running under a different user account on this computer.
Confirm your Username and Host ID using the activation client:
  1. Run the activation client and select "Activate manually without using the Internet."
  2. Choose “I do not have a license file. Help me with the next steps.”
  3. Copy your Host ID and Computer Login Name.
  4. Click the back arrow 2 times and choose “Activate automatically using the Internet” then input the appropriate username.
  5. Launch MATLAB using the appropriate user account.
Activation client requires elevated privileges to run? Connection error when Activating automatically? Still seeing a License Manager Error – 9?
How do I activate MATLAB without an internet connection?

  76 Comments

Kazeem Odunlami
Kazeem Odunlami on 23 May 2020 at 3:31
Thank you. No more error

Sign in to comment.

More Answers (63)

Dandan Zhang
Dandan Zhang on 12 Mar 2016
Note: It's your Windows User Name rather than Microsoft Account Name.
You can determine your Windows username as follows:
  1. 1.While sitting at the host computer with press and hold the Windows key and press the letter R on your keyboard.
  2. 2.The Run box will appear.
  3. 3.In the box, type cmd and press Enter. The command prompt window will appear.
  4. 4.Type echo %username% and press Enter. (there is a space between echo and %username%)
  5. 5.Your current username will be displayed.

  29 Comments

eunkyung cho
eunkyung cho on 16 Apr 2020
It still doesn't work, what should I do?
Colin Fraser
Colin Fraser on 16 Apr 2020
If you are still experiencing this issue, please create a service request below.
-Colin Fraser

Sign in to comment.


Scott Ruffner
Scott Ruffner on 25 Feb 2017
Edited: Scott Ruffner on 25 Feb 2017
I was able to fix the error on my MacBook Pro with the advise above from Scott on the MathWorks Installation & Licensing Support team. I've added a few tips and step by step clarifications for others that may have the same issue.
I was receiving the -9 error. I'm running OS X Yosemite 10.10.5
It seems that you need to know which user on your Mac you are using. To find this out open a terminal window and type "whoami". Copy that result. You will need that at last step of the activation process.
I installed MATLAB in the /Applications folder.
In the terminal window go to wherever you installed MATLAB and find the bin sub-directory. For me this was /Applications/MATLAB_R2016b.app/bin
In the terminal I ran the activation script again by typing "./activate_matlab.sh"
Then I went through the steps "Login to MathWorks" [email/password] >> Next Selected the pre-selected license. >> Next Provide a user name/Login Name: (Paste the user name that you copied when you ran whoami above.)
Then open a new finder window go to Applications and try to run MATLAB_R2016b. It opened this time without errors hope this helps.

  9 Comments

Show 6 older comments
Jaebong Chun
Jaebong Chun on 1 Nov 2019
it is work mac for me macOS Catalina version (version 10.15.1)
Justin Ghetti
Justin Ghetti on 1 Nov 2019
Hi,
If you are still experiencing this issue, please contact MathWorks support:
-Justin
Aditya Shukla
Aditya Shukla on 5 Apr 2020
Thanks a lot, Scott. Worked perfectly for me1

Sign in to comment.


Michael
Michael on 6 Sep 2014
Edited: Michael on 6 Sep 2014
Note for Linux users: when I installed MATLAB on my Manjaro OS, I was required to have 'root' as my username, rather than my actual username.
The solution to this (if you're using a terminal, which is the only way I can access MATLAB), is to open MATLAB as 'root' by entering 'sudo su' (which changes you to root), and then typing 'matlab'.
P.S. The '' marks on words and phrases like 'root', 'sudo su' and 'matlab' are written in this post just to highlight the specific terms and commands. Quotes ('') should not be included when inputting commands into the Terminal.

  17 Comments

Tech Support
Tech Support on 6 Jun 2018
Hi,
If you are still experiencing this issue, please contact MathWorks support:
-Justin
Aditya Lele
Aditya Lele on 26 Nov 2018
Same as "For me, it was just needed to run matlab without root privileges. I was trying to run matlab as a root and it was failing. Without 'sudo', it worked fine."
Luis Ignacio Gómez-Jordana Martín
It work mate. I love you. You save my night, going to sleep finally XD

Sign in to comment.


Calvin McGee III
Calvin McGee III on 5 Feb 2015
Just deactivate license, reactivate it, input your info but this time use your PC's username which you will find in the command prompt as soon as you open it.
Download the license file that is under that username and place it in the correct folder. The path to that folder is given to you when the error window is up. Go that folder first before doing anything. When you find it, there will be a license file already there.
If you are an administrator of the PC remove the license and replace it with the new one. And THEN run MATLAB. It should definitely work for the student version for that is what I have.

  1 Comment

Zach Zehani
Zach Zehani on 1 Sep 2015
+1 - I did precisely this (Have a B: drive) and it worked fine for my student standalone license.

Sign in to comment.


Torgeir Troite
Torgeir Troite on 4 Aug 2015
I had changed my username, but the name of the C:\Users\Username folder hadn't changed, causing a username mismatch. Following these instructions solved the problem:

  0 Comments

Sign in to comment.


Jakob
Jakob on 8 Oct 2014
Edited: Jakob on 8 Oct 2014
The problem appeared for me on Ubuntu Linux 14.04 today, the error message saying that the hostID of my computer did not match the one in the license file.
This was correct, as matlab seems to use the MAC-address of the ethernet controller as the hostID . But somehow (don't know how it happened), my eth0 ethernet device had disappeared , i.e. it was not listed when calling ifconfig -a, lshw showed the ethernet controller as "UNGEFORDERT" and lspci showed the controller, but with no corresponding kernel driver in use (should be e1000e in my case).
matlab obviously took the MAC-adress of my wifi-card instead as hostID which did not match the one in the license of course. Rebooting did not bring my eth0 back.
I then found the following on the internet and did it:
  1. back up this file: /etc/udev/rules.d/70-persistent-net.rules
  2. remove the file
  3. reboot => eth0 was back and matlab started again :)
Hope this helps.

  0 Comments

Sign in to comment.


Payam
Payam on 1 Dec 2014
I have tried all the step in the comments and in the article itself. it does not work. I dont know what the problem is. Please let me know if you do know the solutiopn

  1 Comment

Scott
Scott on 27 Feb 2015
Hi Maa,
If you are unable to resolve this or any other error, please contact MathWorks support. Installation & Licensing support is free for all MathWorks customers, Professional, Academic and Student alike.
Thanks,
-Scott
MathWorks Installation & Licensing Support

Sign in to comment.


Rebel
Rebel on 15 Feb 2015
I caused this problem by disabling a network adapter. (Opening up the device manager and turning off a device called TAP-Win32 adapter under network adapters heading)
Re-enabling the device fixed the problem for me - I was able to start up Matlab with no problems... Hope this helps someone out there.

  1 Comment

Sign in to comment.


Shivaji Rao
Shivaji Rao on 15 Aug 2016
This is what happened when I tried to run MATLAB after installing it on my MAC Book Pro.

  1 Comment

Walter Roberson
Walter Roberson on 9 May 2020 at 7:08
You need to re-activate with username shivajirao

Sign in to comment.


Sebastian Godoy
Sebastian Godoy on 29 Sep 2016
Hey, I also receive this erro. When sudo ./activate_matlab.sh I follow the prompts and everything seems right. However, when following the steps and using sudo to launch matlab it crashes everytime.
what can I do?

  1 Comment

Walter Roberson
Walter Roberson on 29 Sep 2016
On OS-X, you cannot run MATLAB with a Named User license when sudo'd unless you registered root as the name of the authorized user.
It would not surprise me if Linux has the same difficulty.

Sign in to comment.


Zachary Hillman
Zachary Hillman on 15 Nov 2016
Instructions for a code -9 error, wrong Host ID on OS-X El Capitan
I have a student version of MatLab_R2012a_student and it wouldn’t run after upgrading to OS-X El Capitan, I got an error code -9.
The instructions above wouldn’t work, after removing the activation folder and license.dat file it wouldn’t run the Activation program, it gave me an error “There was an unexpected exception “null” See log file . . . .”
With help from MatLab I have compiled these instructions:
1) Put activation folder back into MatLab.app folder
2) Get new Host ID
You might not need to do this as the error from MatLab might give you the Host ID its looking for. Then again you might want to check anyway.
In the Terminal window, enter the following command:
ifconfig en1 | grep ether
The MAC address is the value listed next to "ether".
You need this later to get a new license.
3) Deactivate current license
goto license center
https://www.mathworks.com/licensecenter
click on license
click on Install and Activate tab
click on Deactivate a Computer near the bottom
click on the blue X by the license you are ‘updating’
4) Then get new license file
back to license centre and Install and Activate tab
click on Activate to Retrieve License File near the bottom
enter info on release, OS used, and HOSTID (use lower case, no “:”)
Activation Label is used only on the Mathworks website to lists licenses you have
Download the license file
5) License file will have extension of .lic.txt, probably need to change that to .dat
6) Right click on MatLab icon, then choose show contents
Put license.dat file into the folder licenses
Close Matlab.app ‘folder’
MatLab should start, well at least it did for me.
(Note there is also a bug patch program that needs to be used to run MatLab prior to R2014 after upgrading to Yosemite at https://www.mathworks.com/support/bugreports/1098655)

  0 Comments

Sign in to comment.


Paddy Ryan
Paddy Ryan on 27 Apr 2017
Had the same issue using Matlab on Ubuntu 16.04 LTS running an academic trial.
The solution which worked for me was as follows:
Open Terminal
Type -
cd $MATLABROOT/bin/
This will return:
/bin$
If you type matlab as follows, it loads without any issue
/bin$ matlab
Hope this helps!!

  2 Comments

a a
a a on 2 Jun 2018
It did not work for me. I still get the same error :(
Tech Support
Tech Support on 6 Jun 2018
Hi,
If you are still experiencing this issue, please contact MathWorks support:
-Justin

Sign in to comment.


David Viljoen
David Viljoen on 4 May 2017
Edited: David Viljoen on 4 May 2017
My user name contains a space. As in it is "lastname firstname". When I try to activate I am told that the user name is invalid. I am assuming this is becasue of the space. If I remove the space to make the username "lastnamefirstname" it activates successfully but I then error 9 when opening Matlab. I can't change my default computer name as it is managed by an administrator and used for other applications in our business. Any suggestions?

  1 Comment

Kyle Perry
Kyle Perry on 12 May 2017
Hi David,
If you have trouble activating due to having a username with a space in it, please contact us directly and we can try to find a work around for you. You can find our contact information below:
https://www.mathworks.com/support/contact_us/

Sign in to comment.


Salman Hassan
Salman Hassan on 19 Jun 2017
I am facing the problem in the image provided below.Please help

  8 Comments

Show 5 older comments
Jan
Jan on 27 Oct 2017
@MINGCHAO DU: Please use flags only to inform the admins and editors, that a message might conflict with the terms of use. Post comments as comments. Thanks.
Justin Ghetti
Justin Ghetti on 30 Jan 2020
Hi,
If you are still experiencing this issue, please contact MathWorks support:
-Justin

Sign in to comment.


Darwin Te
Darwin Te on 15 Oct 2017
Edited: Darwin Te on 15 Oct 2017
I resized my VMWare Windows 10 partition from 30gb to 45gb, and changed the snapshot where Matlab is installed to a clone/separate image. Starting matlab gives me this error.
This is because the financial toolbox with IQFeed data provider is not working under Linux so I have to run it under VMware.

  0 Comments

Sign in to comment.