System requirements: Windows 10 (build 19041 or higher), Windows 11.
-
Update Windows first (Windows Update Center).
-
If WSL has not been installed before, then you need to use the following command in PowerShell with administrator rights:
wsl --install
You will also need to reboot the system.
How do I check if wsl is already installed? Enter the following command, which should list the available distributions:
wsl --list --online
- Use the pre-configuration script with setting the parameter to run:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\wslScripts\preconfiguringWsl.ps1
- Updating WSL for 64-bit OS and switching to WSL2:
.\wslScripts\updateWslAndSetWsl2.ps1
Parameters passed to the script:
DistributionName [string] - Specify the name of the distribution that will be displayed later in the wsl --list
InstallLocation [string] - Specify the path to install
UserName [string] - Specify the username in the system
UserPassword [string] - Set the password for the system
DevTools [boolean] - Choose whether or not to install additional packages
.\installUbuntu22.ps1 UbuntuDev .\UbuntuDev NikiYani **** $True
More information can be obtained here: