Fixing WSL errors while generating Linux compatible FMU using FMU Builder
이전 댓글 표시
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
Adarsh
2025년 5월 29일
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
2025년 5월 29일
Adarsh
2025년 6월 4일
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
2025년 6월 4일
Ashwin
2025년 6월 4일
Adarsh
2025년 6월 5일
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
2025년 6월 5일
Abhiram
2025년 6월 9일
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
2025년 6월 9일
Swastik Sarkar
2025년 6월 18일
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
2025년 6월 18일
Swastik Sarkar
2025년 6월 25일
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
2025년 6월 27일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

