MicrosoftDocs / WSL

Source code behind the Windows Subsystem for Linux documentation.
https://docs.microsoft.com/windows/wsl
Other
1.9k stars 563 forks source link

wsl: command not found #1487

Open wingdi opened 2 years ago

wingdi commented 2 years ago

OS : windows 10 , Version 21H1 (19043.928), cpu base x64.

When i execute ‘wsl --install’ , got this error:

'WSL' is not an internal or external command, nor is it a runnable program

微信图片_20220321162313

According document, system env path should have wsl, but apparently don't have. I don't understand from here .

wingdi commented 2 years ago

Then i found this in Trubleshooting:

The term 'wsl' is not recognized as the name of a cmdlet, function, script file, or operable program. Ensure that the Windows Subsystem for Linux Optional Component is installed. Additionally, if you are using an ARM64 device and running this command from PowerShell, you will receive this error. Instead run wsl.exe from PowerShell Core, or Command Prompt.

According this i execute step3 ~ step 5 from https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-3---enable-virtual-machine-feature, and enable ' Windows Subsystem for Linux' in Windows. But step5 , after i execute wsl --set-default-version 2 , i got this : about WSL 2‘s main infomation, please visit https://aka.ms/wsl2

Then I back to install wsl using wsl --install, I got the help list . Then i try wsl --list --online, still got the help list. I don't know where i missed , i am a newer in wsl.