Windows Subsystem for Linux

Let’s work with the Linux kernel in the Windows operating system.

Image : https://www.reviewgeek.com/p/uploads/2021/07/cff2822e.jpg

The Windows Subsystem for Linux allows developers to run a GNU/Linux environment on Windows without the overhead of a standard virtual machine or dual boot setup, including most command line tools, utilities, and applications.

WSL 2

WSL 2 is a new version of the Windows Subsystem for Linux architecture that powers the Windows Subsystem. for Linux to run ELF64 Linux binaries on Windows.

This new architecture modifies how Linux binaries interact with Windows and your computer’s hardware while maintaining the same user experience as WSL 1. (the current widely available version). The WSL 1 or WSL 2 architecture can be used to run individual Linux distributions. Users can upgrade or downgrade either distribution at any time, and you can run WSL 1 and WSL 2 distributions simultaneously.

Installation Guide.

The installation process for Windows Subsystem for Linux has been significantly improved in the latest Windows Insiders preview builds of Windows 10, replacing the manual steps below with a single command.

Step 1: Enable the WSL feature in windows.

Before the installation process, you need to enable the WSL feature on your pc.

path:

control panel > Program and features > Turn windows features on or off

Screen shot : Enable the WSL feature

Open PowerShell as Administrator mode and run this command.

run this command.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

after this process, you need to restart your PC

Step 2: Enable Virtual Machine feature

Open PowerShell as Administrator and run this command

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

Step 3: Set WSL 2 as your default version

Next, you need to Set WSL 2 as your default version. So open PowerShell and run this command.

wsl --set-default-version 2

Step 4: Install your Linux distribution

In this step, you need to install the Linux distribution of your choice.

Open the Microsoft Store and select your favourite Linux distribution My choice is Ubuntu 20.04 LTS edition.

Screen shot : Ubuntu 20.04 LTS edition.

Step 5: Create a user account for your Linux distribution

After the Linux distribution installation, you need to create a user account for your Linux distribution.

Setup user account : https://docs.microsoft.com/en-us/windows/wsl/media/ubuntuinstall.png

After this process, You’ve successfully installed and set up a Linux distribution that is completely integrated with your Windows operating system.

Screen shot : Linux distribution

Extra trick...

Install windows terminal.

Screen shot : windows terminal

Windows Terminal enables multiple tabs (quickly switch between multiple Linux command lines, Windows Command Prompt, PowerShell, Azure CLI, etc), create custom key bindings (shortcut keys for opening or closing tabs, copy+paste, etc.), use the search feature.

Screen shot : Windows Terminal Tab opening
Screen shot : Working with multiple tabs

Summary

The Windows Subsystem for Linux (WSL) is a Windows 10 feature that allows users to use native Linux command-line tools alongside your standard Windows desktop and programs.

Thanks for reading!

Reference:

--

--