Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run windows commands after updating to 1.0.3 #9353

Closed
1 of 2 tasks
ahmetkca opened this issue Dec 17, 2022 · 4 comments
Closed
1 of 2 tasks

Cannot run windows commands after updating to 1.0.3 #9353

ahmetkca opened this issue Dec 17, 2022 · 4 comments

Comments

@ahmetkca
Copy link

ahmetkca commented Dec 17, 2022

Version

Microsoft Windows [Version 10.0.19045.2364]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.79.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220)

Distro Version

Ubuntu 22.04

Other Software

VSCode 1.74.1, 1ad8d514439d5077d2b0b7ee64d2ce82a9308e5a, x64

Repro Steps

I updated to the 1.0.3 just now wsl --update and code . or explorer.exe .

I also tried to run /mnt/c/Windows/explorer.exe . but the same error.

Expected Behavior

I cannot run windows related command anymore such as code or explorer.exe. It was fine before updating to 1.0.3

Actual Behavior

❯ code .
run-detectors: unable to find an interpreter for /mnt/c/Users/ahmet/AppData/Local/Programs/Microsoft VS Code/Code.exe
❯ explorer.exe .
run-detectors: unable to find an interpreter for /mnt/c/Windows/explorer.exe

Diagnostic Logs

No response

@ahmetkca
Copy link
Author

ahmetkca commented Dec 17, 2022

content of the cat /proc/sys/fs/binfmt_misc/WSLInterop

enabled
interpreter /init
flags: PF
offset 0
magic 4d5a

content of /etc/wsl.conf

[boot]
systemd=true

@ahmetkca
Copy link
Author

I run the following command and it fixed but I'll keep this open since it started to happen after updating to 1.0.3

sudo update-binfmts --disable cli

@ahmetkca
Copy link
Author

UPDATE: above command doesn't permanently solves the problem I have to run it every time I restart my computer!

@ahmetkca
Copy link
Author

    Have you followed one of the unrecommended guides on the internet for using “systemd” or “systemd-nspawn” inside WSL? This can cause trouble with the initial WSL environment being discarded.

Originally posted by @DHowett in #6588 (comment)

the content of my /etc/wsl.conf: ( I suspect I tried to enalbe systemd with this approach a while ago)

[boot]
systemd=true

After removing this and running wsl --terminate Ubuntu and wsl --shutdown. It solved the problem permanently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant