-bash: wsl: command not found

iqworks Information Quality Works 196 Reputation points
2022-07-08T22:41:22.843+00:00

I followed these steps from here
https://www.youtube.com/watch?v=NNmxeUQ7XOQ

but at the end of the following steps I wanted to see if my wsl install was version 2 by using this command:
"wsl --list --verbose"
and
"wsl -l -v"

this is the message i got?:
-bash: wsl: command not found

here are the steps i followed from this link :
https://www.youtube.com/watch?v=NNmxeUQ7XOQ

1 – open powershell as admin.
2 - Enable-WindowsOptionalFeatures -Online -FeatureName Microsoft-Windows-SubSystem-Linux
3 -restart machine
4 – dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
5 - dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
6 - restart machine
7 – https://aka.ms/wsl2kernel (this worked for me as his step 7). I downloaded this package and tried to run it: “wsl_update_x64 (3).msi” and I got this :
219174-wsl7n.png
8 – wsl --set-default-version 2

9 – in the search box of the task bar, type “Microsoft store”.
10 – in the Microsoft store search type “kali linux”.
219153-wsl10.png
I typed in a browser search :
https://apps.microsoft.com/store/detail/kali-linux/9PKR34TNCV07?hl=en-us&gl=US
10a – click on “Get in store app”.
219155-wsl10a.png
11 – click on “open Microsoft store”
219144-wsl11.png

12 – on this drop down, click “Open”
219156-wsl12.png
13 – it will open this powershell and ask you for a new username and password
219176-wsl13.png
13a – I misentered my password, so I had to do it again
219192-wsl13a.png
14 – to open kali linux as an app, in the search bar start typing “kali” and you will see this kali linux app. Right click to run as administrator.
219175-wsl14.png
15 – it will open a powershell with this:
219128-wsl15.png
16 – so, we have installed kali linux as an app on windows 10.
17 – Now lets install a GUI for the kali distribution. First update everything by typing the command:
“sudo apt update && sudo apt upgrand -y”. it will ask for your password.
this is what you will see:
219099-wsl17a.png
18 – Now to install the desktop type:
“ sudo apt install kali-desktop-xfce -y “
19 - that will run for a while. But call up another power shell window and confirm you have wsl version 2 installed. I tried these two commands :
“ "wsl --list --verbose"
and
"wsl -l -v"

HERE is where I started getting “**

-bash: wsl: command not found

**”

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,474 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sascha John Hesse 76 Reputation points
    2022-07-09T18:06:06.33+00:00

    bash: wsl: command not found indicates, that you run the wsl command within a linux bash.
    That won't work. I wonder, because you stated out, that you're working in a powershell.
    I see two ways,
    you could try CTRL+D to logout from the bash, and see, if you return to Powershell afterwards or
    just run a plain old cmd (WIN+R -> cmd), which allows you to run wsl -l -v as well


0 additional answers

Sort by: Most helpful