Run Linux on Windows Using WSL2 | Linux
2023/12/15
If you want to practice Linux commands but only have a Windows computer, we recommend installing Windows WSL2 to run a Linux system, so you can easily switch to Linux using Windows Terminal.
It is recommended to use WSL2 instead of WSL
For Windows WSL2, manual installation is recommended
Official Documentation### Check the WSL version on your Windows system
wsl -l -v
Steps
1. Make sure virtualization (VT) is enabled or available on your computer
2. Enable the Windows Subsystem for Linux
- Open PowerShell as Administrator
- Configure
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Restart your computer (required)
3. Enable Virtual Machine feature
- Open PowerShell as Administrator
- Configure
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
4. Download the Linux Kernel Update Package
WSL2 Linux kernel update package for x64 machines
5. Set WSL2 as the default version
- Open PowerShell as Administrator
- Set WSL 2 as your default version
wsl --set-default-version 2
6. Install your Linux distribution of choice
- Open the Microsoft Store and select your favorite Linux distribution.
- Choose the distribution you want
- Install it
- Click Open
- The first time you open it, some initial setup will be performed — please wait
- Set your Linux username
- Set your Linux user password
- Setup is complete