MATLAB Answers

Why do I receive License Manager Error -9?

44,507 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 2 Oct 2019
Edited: MathWorks Support Team on 2 Oct 2019
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?

  52 Comments

Luisa Medina
Luisa Medina about 17 hours ago
Thank!!!! T.T, you save me
Yakub Mohamoud
Yakub Mohamoud 4 minutes ago
Thanks a lot. It worked magical for me.

Sign in to comment.

More Answers (54)

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.

  26 Comments

Congmin Chen
Congmin Chen on 4 Mar 2020 at 10:17
THANKS!!! Very helpful!!!

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.

  8 Comments

Show 5 older comments
Venkata Satya Ramakrishna Raju Kanumuru
Perfect.
Finding the applications folder for deafult installation
First open terminal
command 1: cd -> this will take you to home
command 2: cd ../../ -> this is the folder where Applications folder is.
Continue the above instructions
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

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.

  0 Comments

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.


Xiang cheng Meng
Xiang cheng Meng on 29 Oct 2017
I want to change the name of user.

  3 Comments

Walter Roberson
Walter Roberson on 29 Oct 2017
Re-run the activation. You should not have any problems unless you changed computers, up to a limit of about 4 times per year changing the ID.
James Muchechetere
James Muchechetere on 1 Nov 2017
Having this exact same error.Running the activation again doesn't work and I didn't change machines. Please don't respond if you don't know the answer.
Walter Roberson
Walter Roberson on 1 Nov 2017
Contact Mathworks for free installation support.
There are too many possibilities for us to be able to give an authoritative list of all of the possible causes. Some of the causes are, for example, specific to exactly which update to which operating system you have installed, and to which patches you have installed.

Sign in to comment.


Didier Lauwerys
Didier Lauwerys on 8 Jan 2018
Edited: Didier Lauwerys on 8 Jan 2018
I had this issue. I followed all the steps described here, without any luck. I finally fixed it by installing MATLAB in a directory with user permission
/home/<user>/Programs/MATLAB/R2017b
This meant I could launch the activation software without needing root permissions. For username, I used the username of my ubuntu login. You can find this with
whoami
The license file was generated as it should and I could use MATLAB after.
You will need to launch matlab later by doing
cd /home/<user>/Programs/MATLAB/R2017b/bin
./matlab
I guess you could make a link in the launch menu, but this will at least allow you to start working with MATLAB.

  0 Comments

Sign in to comment.


Felix Frank
Felix Frank on 17 Jan 2018
Running arch linux, for me the activation program failed because the hostid it recovers is wrong. Probably due to different naming of the ethernet adapter.
Solution: Manually create the license file using the website. Enter the correct hostid and username + install matlab in your home folder so you can start it without root access.

  0 Comments

Sign in to comment.


Albert Meseguer
Albert Meseguer on 8 Mar 2018
Edited: Albert Meseguer on 8 Mar 2018
All I need is to be able to access somewhere to change the hostID settings but all the software does is show me the error code and the link to this site. I can't do anything! Please help

  2 Comments

Jan
Jan on 8 Mar 2018
Why do you need to change the HostID? Did you contact the technical support already? See the "Contact Us" link on top of this page.

Sign in to comment.


Ahmed Siddiqui
Ahmed Siddiqui on 10 Mar 2018
I am still facing the same problem after installing uninstalling the software 22 times. My time is being wasted and I need to practice for my tests.
Can someone please help ?

  5 Comments

Show 2 older comments
Jan
Jan on 25 Mar 2018
Again: A re-installation is not useful. The accepted answer explaines:
To resolve this issue, you need to reactivate MATLAB using the
correct host ID/Username
Please try this and if it does not work, contact MathWorks.
Saiyin Li li
Saiyin Li li on 21 Aug 2019
How can I change my username?
Walter Roberson
Walter Roberson on 21 Aug 2019
https://www.computerhope.com/issues/ch000767.htm gives step by step instructions for changing your windows username.
Be careful about whether your existing directories get moved when you change your username.
Note that changing your windows username is seldom the solution to an Error 9 problem. Potentially changing your username could help some Simulink and third party software related problems if your existing username has some non-English characters, so it can sometimes be useful, but it does not tend to affect Error 9.
Generally, Error 9 problems are from having given the wrong name when you registered the software and it asked who would be using the software. On Windows system, be sure to give your local account name, not your Windows Live email address.

Sign in to comment.


Vikas Gupta
Vikas Gupta on 16 Apr 2018
Hey i am having ubuntu 16.04 so "whoami" prints your username and if you are using sudo then enter root in login name and your username should not contain spaces if it does then change it

  0 Comments

Sign in to comment.



Shan Zhang
Shan Zhang on 28 Aug 2018
Why do I receive License Manager Error -9,57?

Suppalerk Jampangern
Suppalerk Jampangern on 2 Sep 2018
I use my student licence on my sister computer(that i use as my own now), so it is a different user. when I installed, I used my old userID instead of my sister's userID. Is that any ways I can change hostID without creating new mathlabID or new userID in my computer?

  2 Comments

Walter Roberson
Walter Roberson on 2 Sep 2018
If you are still using the same computer, then the hostID did not change. If you changed login names then the easiest thing to do is to go back to the old login, deactivate MATLAB, then go to the new login and activate MATLAB.
Suppalerk Jampangern
Suppalerk Jampangern on 2 Sep 2018
Thank you so much. I can use MATLAB now.

Sign in to comment.


guangpeng liu
guangpeng liu on 23 Nov 2018
error.png,when i finish the installation , there is a error as showed in the picture ,could anyone tell me how can i solve the problem?thanks

  0 Comments