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!

