WSL: Interop Issue: unable to find interpreter for launching Windows .exe files using Interop
Environment
Windows build number: Microsoft Windows [Version 10.0.19613.1005]
Your Distribution version: Release: 18.04
Whether the issue is on WSL 2 and/or WSL 1:Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020
Steps to reproduce
- Attempt to run Windows .exe that are in my WSL path: ~$ which code /mnt/c/Users/gfinn/AppData/Local/Programs/Microsoft VS Code/bin/code
~$ code run-detectors: unable to find an interpreter for /mnt/c/Users/gfinn/AppData/Local/Programs/Microsoft VS Code/Code.exe
Expected behavior
Windows executable would launch
Actual behavior
Error message shown above: run-detectors: unable to find an interpreter for /mnt/c/Users/gfinn/AppData/Local/Programs/Microsoft VS Code/Code.exe
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 37 (1 by maintainers)
@jdknox I can fix this problem by executing the following command:
restarting wsl with power shell >
wsl --shutdownhelped.I am on a relatively fresh copy of ubuntu 20.04 in wsl2. I noticed it having this issue last night. I do not that I never installed docker inside the wsl environment, and enabled the wsl feature in docker for windows. When running some of the above commands I get these outputs:
libmono
I know I have been able to run say vscode through wsl before and worked fine. I discoverd the issue when trying to run it again and got the same error
If I run command in https://github.com/microsoft/WSL/issues/5466#issuecomment-695155716
will that disable running the windows applications from the wsl cli?
EDIT: I tried the above command anyways, and it fixed the issue for me.
Uninstalling the
mono-runtimepackage viasudo apt remove mono-runtimealso resolves the issue.See https://github.com/microsoft/WSL/issues/9257#issuecomment-1352443162
I just wanted to mention I had this same problem, and none of the troubleshooting steps from above added any clues on how to solve. But I had recently
apt installed some things and went through those to see what I could see. Turns outnugetadded somelibmonostuff that broke myinteropability. As soon as I removed that package, everything starting working again.But I would add, the error message is a bit cryptic out-of-context. Maybe it should mention something about WSL for those of us who are plain, old uninitiated mortals?
Permanently solved by uninstalling mono-runtime.
This totally worked for me, and the cause for the error was because I had installed something with libmono
I also have the similar issue starting today, I am unable to run any windows related executables. I am using Linux 4.19.121-microsoft-WSL2-standard, Windows 10 20150.1000 Close docker for Windows(WSL2 backend) actually helps me, so it is possibly a docker related issue
For future info: After installing “mono-complete” on my WSL2, for dotnet programming in vscode, i had this same issue, and this command fixed it.
To re-apply the fix after WSL reboots, I’ve added this bit among many other hacks into my
~/.profile:So it tries to run whatever Windows exe that is supposed to exit quickly and successfully, and if it fails - applies the fix from this thread. Should only happen once per WSL boot and subsequent log-in (which is also parsed when Docker Desktop starts and causes WSL to start).
So, any of:
sudo update-binfmts --disable clisudo apt remove mono-runtimehttps://github.com/microsoft/WSL/issues/9257#issuecomment-1352443162systemd=truetofalsein/etc/wsl.conf(source)resolve the issue apparently (while 1. is temporary and only persists until the next restart of WSL). The common cause seems to be the (indirect) install of
mono-runtimepackage.Personally disabling
systemdis not an option given that I just spent a lot of time & effort getting SSH to auto-start in WSL…Is anyone aware of the actual root cause? (Or was that already covered above?)
It should be caused by the conflict with systemd.
Please check the file
/etc/wsl.confand see if thesystemd = trueflag was added under[boot]settings as shown below. If so, please switch it to false.For more info, please refer to https://learn.microsoft.com/en-us/windows/wsl/wsl-config#per-distribution-configuration-options-with-wslconf
This also worked for me
WSL isn’t going to inject anything
systemdrelated, anywhere. You probably have critically missing steps in the repro. To test that hypothesis, install a clean 20.04 (only because you’re on 18.04 not for the upgrade), see if notepad.exe works.This started after a Visual Studio Code upgrade.