Fixing WSL errors while generating Linux compatible FMU using FMU Builder
Ältere Kommentare anzeigen
I am trying to generate a Linux compatible FMU using FMU Builder for a Simulink model. The windows version of the FMU is generated withour any errors and it works well. But while generating a Linux compatible FMU, I get an error. I have attached a screenshot of the error below.
I have WSL2 installed on my system (5.15.167.4-microsoft-standard-WSL2).
How do I fix this error?

13 Kommentare
Adarsh
am 29 Mai 2025
Can you follow the steps mentioned in below documentation link and provide the output that you receive:
Also can you please ensure that you are using correct versions for MATLAB, WSL and FMU Builder support packages as mentioned in the documentation link below:
https://www.mathworks.com/help/slcompiler/ug/fmu-cross-platform-compilation.html
Ashwin
am 29 Mai 2025
Adarsh
am 4 Jun. 2025
Can you please try the following,
- Run the command "wsl --set-default-version 2" and retry the export to FMU feature.
- Uninstall existing WSL distros and Reinstall WSL again and retry the export to FMU feature.
Also can you share the output of the following command in windows powershell : "wsl --list".
Also please ensure "Virtual Machine Platform" and "Windows Subsystem for Linux" is enabled in "Turn Windows Features on or off" window.
Ashwin
am 4 Jun. 2025
Ashwin
am 4 Jun. 2025
Adarsh
am 5 Jun. 2025
Can you also share the output of 'wsl -l -v' command.
Also can you try the following commands:
- Try running 'wsl --set-default <DistributionName>', replacing <DistributionName> with the name of the Linux distribution you would like to use.
- Try running 'wsl --set-version <distro name> 2' replacing <distro name> with the name of the Linux distribution
Also please share the outputs of these commands as well.
Ashwin
am 5 Jun. 2025
Abhiram
am 9 Jun. 2025
Can you try resetting MATLAB's preferences by renaming or deleting the preferences directory (making sure to back it up first). The location can vary, but it's typically found under:
C:\Users\<YourUsername>\AppData\Roaming\MathWorks\MATLAB\
Rename the folder related to your MATLAB version by appending "_backup" to the folder name. MATLAB will recreate the preferences folder with default settings next time it starts.
Ashwin
am 9 Jun. 2025
Swastik Sarkar
am 18 Jun. 2025
The second error — "Failed to convert WSL1 to WSL2" — might be a consequence of the initial issue: "Failed to import custom distro on Windows Subsystem for Linux."
This could be due to a corrupted installation of the FMU Builder Add-on. I recommend reinstalling the add-on and then attempting to build the FMU executable again.
Additionally, please provide the output of the following command.
wsl -l -q
Ashwin
am 18 Jun. 2025
Swastik Sarkar
am 25 Jun. 2025
Please check the contents of the following directory to see if there is any wsl distro.
Additionally please check if you have the permission to write to this folder
fullfile(matlabshared.supportpkg.getSupportPackageRoot(),'toolbox','shared','simulink','fmubuilder')
Ashwin
am 27 Jun. 2025
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Simulink Environment Customization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

