Skip to content

Commit

Permalink
Revise fix (from a759deb) for running Windows .exe files from a WSL/U…
Browse files Browse the repository at this point in the history
…buntu command prompt when mono-runtime is installed and systemd is enabled.

The last "fix" ("update-binfmts --disable cli") would only fix the problem temporarily; the problem returned when WSL was restarted. (With this commit the problem doesn't come back after WSL is restarted.)
  • Loading branch information
shaneharper committed Nov 7, 2023
1 parent a759deb commit 0f577b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ echo About to install python3-dev and mono-complete.
sudo apt install --assume-yes python3-dev mono-complete # Install packages needed by YouCompleteMe Vim plugin. xxx It'd be nice to only ask for a password (run sudo) if a required packages isn't installed - See https://stackoverflow.com/a/10439058. xxx Move this to vimrc to be near the code that installs YouCompleteMe.

if [[ $(uname -r | grep WSL) ]]; then
sudo update-binfmts --disable cli # Without this (and with mono-runtime - part of mono-complete - installed and with systemd enabled) trying to run a Windows exe from WSL/Ubuntu doesn't work, e.g. "run-detectors: unable to find an interpreter for /mnt/c/Windows/system32/cmd.exe" is output when trying to run cmd.exe (Ubuntu 22.04.3, mono-runtime 6.8.0.105+dfsg-3.2).
sudo update-binfmts --package 'mono-runtime' --remove cli /usr/bin/mono # Without this (and with mono-runtime - part of mono-complete - installed and with systemd enabled) trying to run a Windows exe from WSL/Ubuntu doesn't work, e.g. "run-detectors: unable to find an interpreter for /mnt/c/Windows/system32/cmd.exe" is output when trying to run cmd.exe (Ubuntu 22.04.3, mono-runtime 6.8.0.105+dfsg-3.2).
fi

0 comments on commit 0f577b0

Please sign in to comment.