
WSL in Command Prompt / PowerShell
Commands
wsl --help
Opens a WSL usage guide with a list of available arguments and options.
wsl --list
List the WSL distros installed on your system.
wsl -u root
Starts default WSL distro and logs in at root.
To shutdown / exit the WSL distro, type exit and press the Enter key on your keyboard.
Setting up Ubuntu app in Windows 11 WSL- Quick guide
- Make sure virtualiziation is activated in your computer's BIOS.
- Run appwiz.cpl
- Click Turn Windows features on or off in the left pane and wait for the list to be populated.
- Make sure the features Virtual Machine Platform and Windows Subsystem for Linux are turned on. If you have to select one of them or both to turn it/them on, do so and then reboot the computer.
- Downlad and install the Linux kernel update package. There are two versions available, x64 and ARM64.
If you're not sure what kind of machine you have, open Command Prompt or PowerShell, enter: systeminfo and check out info on the row System Type
Linux kernel update package downloads:
wsl_update_x64.msi
wsl_update_arm64.msi - Start PowerShell and run the command wsl --set-default-version 2
- Go to Microsoft Store and get the Ubuntu app installed.
- Run the Ubuntu app and follow the install instructions.
Ubuntu in WSL
Commands
Check version of distro you're in.
cat /etc/issue.net
When logged in into the WSL Ubuntu distro as root, use the command below to set/change a user password.
passwd username
Get network connection working
If you get no network connection in your WSL distro, try this;
Set proper DNS address in /etc/resolv.conf (The same address as the one in the output from ipconfig /all command on Windows host running the WSL)
You should try resetting the TCP/IP stack and clearing any DNS information on Windows host running the WSL (Windows 10).
To reset the network stack with Command Prompt, use these steps:
1. Open Start.
2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
3. Type the following command to reset the component that handles network requests and press Enter:
netsh winsock reset
4. Type the following command to reset the internet protocol stack and press Enter:
netsh int ip reset
5. Type the following command to clear the current networking configuration and press Enter:
ipconfig /release
6. Type the following command to reconfigure the network settings and press Enter:
ipconfig /renew
7. Type the following command to clear the DNS information cached and press Enter:
ipconfig /flushdns
8. Restart your computer.
Once you complete the steps, launch the web browser and confirm the internet is working.