WSL (Windows Subsystem for Linux) is a very useful feature in windows that opens up various opportunity to use Linux environment on windows machine, that too with an actual Linux Kernel support. However, the installation is not straight forward and we need to execute several commands before it is actually gets ready to install Linux system on it.
The step by step instruction for setting up WSL and ubuntu installation is provided below.
Step 1: Enable Windows Subsystem for Linux
# open powershell in ADMINISTRATOR privileged
# run the following command
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Step 2: Check requirements for running WSL 2
# check compatible version
WIN Key + r --> type winver --> enter or press ok
# check the version and it should match following condition, lower version doesn't support WSL2, please update OS as needed
amd64:
version > 1902
version > 18361 (Build)
arm64:
version > 2003
version > 19040 (Build)
Step-3: Virtual Machine
# open powershell in ADMINISTRATOR privileged
# enable virtual machine
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# reboot
shutdown -r
Step-4: Update Kernel package
Download update package:
Step-5: Set WSL 2 as default version
# open powershell in ADMINISTRATOR privileged
# run on powershell
wsl --set-default-version 2
Setup-6: Install Linux distribution (Ubuntu in our case)
- Open Microsoft store
- Search for Ubuntu 18.04
- Install using the
getbutton
Setup-7: Configure Linux distribution
- Once the installation is completed, we will need to configure linux distribution. So simply search for the Ubuntu program and lunch it from the start menu (alternatively open powershell with admin privileged and run wsl ) and follow the instruction as provided in the console.
This should complete the Linux installation.
