First you need to enable the optional features on windows operation system. Then you can install a WSL from Microsoft store or by using the command line. Finally, you can choose to update the WSL 2 for improvement in performance and features.
✅ Prerequisites
-
You need Windows 10 version 2004 or higher, with Build 19041 or later.
-
Make sure you're running Windows 10 Home or Pro.
🚀 Use the below stapes to enable the optional features and to install WSL using command line.
1. To enable the optional features:
Open PowerShell as Administrator:
Search PowerShell in the start menu and select "Run as Administrator".
To install WSL on windows sysem we have to enable bellow two features:
1) Microsoft-Windows-Subsystem-Linux
2) Virtual Machine Platform ( for WSL 2)
Steps to enable optional features using command line (PowerShell):
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
To enable Virtual Machine Platform run the following command in PowerShell:
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
As we mentioned "/norestart" in every command line, system may not be prompt to restart. So once you run all above command then manually restart your system and continue the next steps as below.
Steps to install Linux Distribution:
Form Microsoft Store:
To install from the Microsoft Store, search for your desire distribution like Ubuntu in the Microsoft Store and install it and follow the installation steps if any require.
Using the Command line:
Open PowerShell as an Administrator and use the following command :
> wsl --install -d <Distribution Name> (e.g., wsl --install -d Ubuntu).
(Optional) : Update to WSL 2 and Set Default:
- Download the Linux kernel update : Download the packages from the Microsoft website.
- Set WSL 2as Default :
0 Comments