If you are a Windows user but likes to write programs for Raspberry Pi or something similar that runs Linux. Or you just like the power of Linux terminal commands. Than this is the easiest way to do all this Linux stuff still using Windows.
Well, the key to this magic is WSL (Windows Subsystem for Linux). It is actually a layer of software that you very easily install on your Windows machine and it allows you to run Linux programs on Windows. Well actually it adds all Linux missing stuff on top of the Windows so that at the end you end up with almost fully functional Linux terminal that you can access through Windows Command Prompt or PowerShell.
There are two versions of WSL. Version 1 and 2. Version 1 just provides a compatibility layer that translates Linux system calls into equivalent Windows system calls. While with version 2 you get a lightweight virtual machine which includes a complete Linux kernel. And WSL version 2 is currently the default installation option.
How do you install WSL?
The short answer is … you just open the Windows Command Prompt or PowerShell in administrator mode and run the following command:
wsl --install
This will install WSL version 2 and the Ubuntu distribution of Linux by default.
If you are interested in other Linux distributions (or by running the above command you get help text) you can list them with command
wsl --list --online
And then install with
wsl --install -d <DistroName>
where you replace <DistroName> with one of the names that “wsl –list –online” command returned.
Or check this official Windows link for help to achieve something else or just as a reference about WSL.
Finish the installation.
After the Linux distribution is installed, you are prompt with a command line window asking you to create a new UNIX username and password. And when you are done you have a fully functional Linux terminal. That’s it.
How to open Linux terminal?
If you just started your Windows machine and you want to open your new Linux terminal, you just open the Windows Command Prompt or PowerShell and write
wsl -d <InstalledDistroName>
If you have troubles finding out the name of your installed Linux distribution name, you can fun list command
wsl --list
And just to wrap thing up here is an example of command that I use to run my Ubuntu-22.04 LTS terminal
wsl -d Ubuntu-22.04
Visual Studio Code extension
If you like to use VS Code IDE for coding than this Microsoft official WSL plugin extension will come handy.
Just search for “WSL” and it should be the first result that pops out. (Plugin identifier is: ms-vscode-remote.remote-wsl)

When the plugin is installed, you can click on the green button on the bottom-left of the VS Code.

A prompt menu shows up … you click “New WSL Window using Distro…” …

… select your installed Linux distribution (in my case Ubuntu-22.04) …

… and a new VS Code window should open – now running inside your installed Linux distribution.