Can I install MATLAB in Bash on Ubuntu on Windows?

276 views (last 30 days)
The Windows 10 Anniversary update (Windows 10 build 1607) has an option to install a Bash shell based on a minimal Ubuntu 14.04 environment. Can I install MATLAB in this environment?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Dec 2018
Bash on Ubuntu on Windows is a minimal installation of Ubuntu and therefore lacks many of the libraries that MATLAB requires to install and run that would be present in a normal Ubuntu Linux installation. This configuration is not qualified for MATLAB.
Caterina Brighi
Caterina Brighi on 15 Sep 2020
Hi, I am having troubles with the installation of Matlab R2020a on my Ubuntu 18.04 WSL2. I am trying to use the silent installation instructions, by populating the installer_inut.txt file with the output folder, activation key, etc... the command run, but no folder gets created in my output directory. Any advice on how to fix this?

Sign in to comment.

More Answers (7)

Winston Yu
Winston Yu on 17 Aug 2018
Edited: Walter Roberson on 17 Aug 2018
There are several things need to be fixed for default ubuntu on Windows 10
1. update basic library (for R2018a, MATLAB use glibc 3.4.22)
sudo apt-get install libstdc++6
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
2. install display library like mesa library (assume you are using opengl)
apt-get install mesa-utils
3. install jdk
apt-get install default-jdk
4. install execstack
apt-get install execstack
5. As George Yammine suggest, clean ELF of blas and lapack library, at matlabroot/bin/glnxa64, run command:
execstack -c
execstack -c
execstack -s MATLAB
Aaron Earle-Richardson
Aaron Earle-Richardson on 10 Mar 2022
I tried this for the newer MATLAB versions but the specific ELF files mentioned don't seem to exist. I tried runner the interactive installer and the window opens but it's blank. Any workarounds?

Sign in to comment.

Enrico Schulz
Enrico Schulz on 18 Sep 2017
Which library is exactly missing? It is very easy to add every needed library. There's lot of software that is actually runing, including graphical nautilus, synaptic, FSL etc. with xlaunch.
matlab -nodesktop -nodisplay -nojvm -nosplash Without the need for any graphical output I am running into the following error message: MATLAB: detail/MvmLocalBoundMethods.cpp:114: static void mvm::detail::MvmLocalBoundMethods::initMethods(bool): Assertion `Failed to open local mvm library: cannot enable executable stack as shared object requires: Invalid argument' failed. Aborted (core dumped)
Best wishes!
Philip Borghesani
Philip Borghesani on 3 Nov 2017
That error appears to be related to this missing feature: cannot enable executable stack as shared object requires. No missing library is causing the issue.

Sign in to comment.

Mufti Mahmud
Mufti Mahmud on 2 Oct 2017
Dear MathWorks Support Team,
as the installation goes on well without any problem, would it be possible to let us know the required libraries to run which we may try to install manually and use it from the Bash!
That would be great!
Many thanks!

alexandre obert
alexandre obert on 27 Oct 2017
The same error occurred when trying to implement Runtime through linux native programs - I've got ths error with freesurfer. I do not find any valuable solution by now...

Sign in to comment.

Philip Borghesani
Philip Borghesani on 3 Nov 2017
I am curious Why would anyone want to do this? I can think of a few reasons, that I don't think are very good, but can think of no showstopper reason. I am not going to list my ideas here to avoid tainting the list.
What problem do you expect to solve or feature do you expect to gain by running Linux MATLAB on Windows instead of Windows MATLAB? Please post responses as comments to this answer.
Mahmod Karndash
Mahmod Karndash on 25 Apr 2022 at 21:07
Please help , how do you install Matlab 2018a for Linux on Ubuntu WSL.I am using ubuntu16.04 wsl and I tried to install matlab r2018a but I can not, please help
When running the Installer on Linux, I see the below in terminal:
Preparing installation files …
Installing …
the installer does not launch and MATLAB is not installed.
root@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives installer_input.txt patents.txt version.txt
bin install_guide.pdf readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo ./install
Preparing installation files …
Installing …
I tried using the suggested solution from mathworks but it didn’t work:
oot@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives install_guide.pdf patents.txt version.txt
bin installer_input.txt readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo chmod -R 777 matlab_R2018a_glnxa64
chmod: cannot access ‘matlab_R2018a_glnxa64’: No such file or directory
please help وMy work and results are stalled because of that
thank you in advance

Sign in to comment.

Francois on 9 Mar 2018
Is there any hope for having this working at some point?
The one thing I tried for getting rid of these errors is the following:
execstack -s glnxa64/
execstack -s glnxa64/
But then the execution simply stops after displaying the message "MATLAB is selecting SOFTWARE OPENGL rendering", without any error.
This would be helpful for setting up some specific research software environments, that require combinations of many programs (MATLAB, SPM, FreeSurfer, ...) in Windows environments.

Sabyasachi Ghosh
Sabyasachi Ghosh on 22 Oct 2021
Is this still not possible, even with WSLg? I get the following error:
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to launch web window with error: Unable to launch the MATLABWindow application. The exit code was: 127
  1 Comment
cui on 27 Nov 2021
Is your platform windows 10 or 11, WSLg is not supported on windows 10, and windows 11 is still immature?

Sign in to comment.


No tags entered yet.


Community Treasure Hunt

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

Start Hunting!