Can Microsoft's WSLg (Windows Subsystem for Linux GUI) support running matlab?
128 views (last 30 days)
Show older comments
cui,xingxing
on 27 Nov 2021
Commented: cui,xingxing
on 21 Dec 2022
Has anyone had success running matlab desktop applications using WSLg?I have not successfully configured it in windows 10 21H2, but after checking the previous information, I just need to install the necessary base library jdk, execstack to install matlab on WSL, but now I think the best way to implement the desktop matlab application is through WSLg, but lack of specific tutorials, I hope the successful ones can give Thanks in advance for the installation guide!
4 Comments
Sunip Mukherjee
on 20 Dec 2022
I managed to install R2020a on WSLg (Win 11 22H2) using the /path/to/installer/bin/glnxa64/install_unix_legacy installer. Post install everything works, matlab launches with GUI in soft OpenGL mode (can be overridden with -nosoftwareopengl). The only issue seems to be with Simulink. If I right click on the simulink window, the context menu pops up randomly somewhere else on the screen. Left click and mouse movement works normally. Performance seems to be fine as well.
Accepted Answer
Thomas Carpenter
on 1 Dec 2022
As of next month (the Dec 13 2022 patch tuesday), it will be possible to use WSLg with Win 10 version 21H2. In fact you can get it now by installing the preview (KB5020030) from the microsoft update catalogue.
Microsoft have backported the WSL windows store version to support Windows 10 once that update is installed, allowing GUI apps to work. Once the store version is installed, you need to update the wsl distro to make sure the new MESA drivers are installed inside WSL.
With appropriate NVidia/AMD driver on the windows side of things, you can also get hardware OpenGL to load, however it seems quite unstable (it's fine with software OpenGL).
I'm using R2019a, which seems to have a version of libstdc++.so.6 that doesn't support the WSL2 graphics support, however this can be overcome by simply renaming MATLABs builtin version so that it uses the system library which does support it:
cd /usr/local/MATLAB/R2019a/bin/glnxa64/../../sys/os/glnxa64/
sudo mv libstdc++.so.6 libstdc++.so.6.orig
After that, launching MATLAB with matlab -nosoftwareopengl & loads correctly with hardware OpenGL support, however attempting to plot anything causes MATLAB to crash with a segmentation fault in the graphics driver.
0 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!