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

wsl in terminal: The system cannot find the path specified. #9865

Open
1 of 2 tasks
ITCJ opened this issue Mar 29, 2023 · 11 comments
Open
1 of 2 tasks

wsl in terminal: The system cannot find the path specified. #9865

ITCJ opened this issue Mar 29, 2023 · 11 comments

Comments

@ITCJ
Copy link

ITCJ commented Mar 29, 2023

Windows Version

Microsoft Windows [版本 10.0.22621.1413]

WSL Version

can't reach

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

any wsl related bash could not work, included vscode
it report The system cannot find the path specified.
image

but I could boot wsl directly by running the wsl.exe in WindowsApps folder
image
image

Expected Behavior

wsl successfully run and detected by vscode

Actual Behavior

report The system cannot find the path specified.

Diagnostic Logs

No response

@benhillis
Copy link
Member

I suspect you're running the x86 version of powershell?

@ITCJ
Copy link
Author

ITCJ commented Mar 31, 2023

I suspect you're running the x86 version of powershell?

yes, my cpu is amd ryzen 4800h

@ITCJ
Copy link
Author

ITCJ commented Mar 31, 2023

I have tried reinstall wsl as the doc https://learn.microsoft.com/zh-cn/windows/wsl/install-manual. But doesn't work.

I also tried reinstall from Windows Store, but it didn't work, too.

@ITCJ
Copy link
Author

ITCJ commented Mar 31, 2023

I solved this problem.

It seems is caused by uncompleted update of Linux subsystem for windows by Microsoft Store.

I discovered that EveryThing found two wsl.exe which is 1.1.6 and 1.1.3. I uninstall them both and then reinstall from Microsoft Store. Then the wsl bash worked again.

image

@renata-coder
Copy link

I have same problem that yours, but even following your tutorial I was no sucesssful. Could you detail the step about uninstall these two wsl.exe ?

@ITCJ
Copy link
Author

ITCJ commented May 31, 2023

I have same problem that yours, but even following your tutorial I was no sucesssful. Could you detail the step about uninstall these two wsl.exe ?

sorry for late reply.
It's been a long time and I don't quite remember. Did you figure out how to uninstall them?

@gui2dev
Copy link

gui2dev commented Sep 1, 2023

Same issue here.
Any wsl command from user cmd / powershell / powershell 7 (x64) would give the same The system cannot find the path specified. response.
As and admin, it would say I have no distrib.
Asking "where" is wsl I am getting :

C:\WINDOWS\system32>where wsl
C:\Windows\System32\wsl.exe

Trying to use wsl.exe in C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe command line from cmd / powershell as an admin or a user would raise the same Access is denied error.

C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe>wsl.exe
Access is denied.

@paigeman
Copy link

paigeman commented Jan 20, 2024

I encountered a similar issue. However, I'm uncertain if it's for the same reason, as I switched the default application for .cmd files a few months ago. (I also don't know how to fix it.) Nevertheless, I can run WSL2 by pressing win + R on the keyboard and then entering wsl.
------------------------edit---------------------------------------
After updating WSL by pressing Win + R and entering wsl --update, I was able to run WSL through both the command prompt and PowerShell.

@danbran99
Copy link

I solved the problem of my side ... I had windows 11 home... I upgraded for windows 11 pro for 100$. I uninstalled and reinstalled all the features related to wsl and it works. I suspect you need a pro version of windows.

@ITCJ
Copy link
Author

ITCJ commented May 2, 2024

I encounter this problem again when I trying to reinstall WSL. For now I can't find WSL in Microsoft store. So, I manually install from github release the .msi file.

I think that's a good solution, but no auto update supported.


The reason why I uninstall WSL is that I can't apply .wslconfig for some reason. So I want to reinstall WSL.

@daniel-dewww
Copy link

Captura
I ran this file and then wsl.exe in powershell and it was resolved although other problems came later that I was able to solve

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

7 participants