Search code examples
linuxmatlabubuntuubuntu-20.04

How would you properly install MATLAB in ubuntu that is running on WSL2?


I want to install matlab in ubuntu 20.04, but I'm running ubuntu in WSL2 and it doesn't want to work. I keep getting the error: terminate called after throwing an instance of 'framework::window::DisplayError what(): No. Display Avaliable.

I have the linux version of matlab unzipped in a folwer and I'm trying to instal it into the user files. Things I've tried to install it that were suggested for people having the same issue on other distros:

sudo ./install
./install
bash install
install
bash ./install
sudo bash ./install
sudo su and then doing ./install
export DISPLAY=:0.0 and then sudo ./install
bash ./install -v -inputFile installer_input.txt

It gives the same error for every one that I've tried.

Let me know if anyone has any solutions. Thanks.


Solution

  • Posting this to help out others in the future. It actually involved a few things to get this fully working properly:

    1)Had to get a X Server

    2)Had to change display settings in ubuntu to get it to recognize the X server and turn off some firewall features for Windows.

    3)Had to when installing matlab install using the legacy install file instead of the normal install file