Installing WSL2 on windows

Published: 19 March 2024
on channel: CSE Practicals
510
6

To install WSL2 (Windows Subsystem for Linux 2) on your Windows machine, follow these steps:

Check System Requirements:
Before proceeding, ensure that your Windows version supports WSL2. WSL2 requires Windows 10 version 1903 or higher with Build 18362 or higher. You can check your Windows version by typing winver in the search bar and pressing Enter.

Enable Virtualization:
Make sure that virtualization is enabled in your BIOS settings. Most modern computers have this enabled by default, but it's worth verifying.

Enable Windows Subsystem for Linux:
Open PowerShell as an administrator. You can do this by searching for PowerShell in the Start menu, right-clicking on it, and selecting "Run as administrator." Then, run the following command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable Virtual Machine Platform:
Still in the PowerShell window, enable the Virtual Machine Platform feature by running the following command:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Download WSL2 Linux Kernel Update Package:
Visit the following link to download the WSL2 Linux kernel update package:
WSL2 Linux kernel update package

Install the Linux Kernel Update Package:
After downloading the package, double-click on it to install the Linux kernel update.

Set WSL2 as Default Version:
Open PowerShell as an administrator again and run the following command to set WSL2 as the default version:


wsl --set-default-version 2
Install a Linux Distribution:
You can now install a Linux distribution from the Microsoft Store. Open the Microsoft Store, search for your preferred Linux distribution (e.g., Ubuntu, Debian, etc.), and install it.

Launch and Set Up Linux Distribution:
Once installed, launch the Linux distribution from the Start menu. The first time you launch it, it will take some time to set up. Follow the on-screen instructions to complete the setup, including creating a user account and password.

Update and Upgrade (Optional):
After setting up your Linux distribution, you may want to update the package lists and upgrade existing packages. You can do this by running the following commands in the Linux terminal:


sudo apt update
sudo apt upgrade

That's it! You have now successfully installed WSL2 on your Windows machine. You can now use Linux commands and utilities directly from your Windows command prompt or PowerShell.


Watch video Installing WSL2 on windows online, duration hours minute second in high quality that is uploaded to the channel CSE Practicals 19 March 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 510 times and liked it 6 visitors.