Container (1), WSL

This series of articles is about Docker, or Container, due to I cannot get the suitable category, so I designate it to DevOps because the container is used for CI/CD (Continuous Integration and Continue Deployment).

  • Container (1), WSL --- this article
  • Container (2), Windows Terminal
  • Container (3), Docker
  • Container (4), Installing SQL Server into Docker


When I installed Docker Desktop on my Windows machine, I got this message after the first run for Docker:

Then I realize WSL is a must for installing Docker (another choice is to use Hyper-V backend and Windows containers). What is WSL? This article will cover this topic, and the contents are as follows:

  • A - Introduction
  • B - What is WSL
  • C - WSL Installation in Windows 11
  • D - Ways to Run Linux Distribution

B - What is WSL

WSL is a Windows Subsystem for Linux that allows users to run a Linux terminal environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup.

WSL 2 is a new version of the WSL architecture running ELF64 Linux binaries on Windows to increase file system performance and add full system call compatibility.

Individual Linux distributions can be run with the WSL 1 or WSL 2 architecture. Each distribution can be upgraded or downgraded at any time, and WSL 1 and WSL 2 distributions can be run side by side. WSL 2 uses an entirely new architecture that benefits from running a real Linux kernel.

Note: A Linux distribution is an operating system made from a software collection that includes the Linux kernel and often a package management system.

C - WSL Installation in Windows 11

Install WSL by either PowerShell or Windows Command Prompt with admin tight [ref]:

wsl --install

The installation request is successful, and a reboot is required. After rebooting, the installation continue, and the system will ask you to set up the admin username and password, which could be independent of your Windows credential:

After installation, you can check the version by

wsl -l -v

This command will install the WSL version 2 and the default Ubuntu distribution of Linux by default. This default distribution can be changed by

wsl --install <Distribution Name>

Such as

wsl --install Debian

I will install the Debian distribution as a default. For a valid list of distribution names, run.

wsl --list --online


D - Ways to Run Linux Distributions

WSL supports running as many different Linux distributions. There are several ways to run your Linux distributions.

1, Windows WSL:

Windows Start => wsl: --- Open the default distribution

Click to open:

2, Windows with Distribution Name:

Windows Start => Ubuntu --- Open the specific distribution


View the directory by:

3, Windows Command Prompt or PowerShell, with distribution Name.

For example: ubuntu

4, From Windows Command Prompt or PowerShell, wsl.exe

Open the default Linux distribution inside the current command line by entering the following: wsl.exe

5, From Windows Command Prompt or PowerShell + wsl command

Use the default Linux distribution inside the current command line without entering a new one by entering:wsl [command]. Instead, replacing [command] With a WSL command, For example:

To see where the current directory path is mounted in wsl

wsl pwd

To view the directory contents:

wsl ls

To list installed distributions:

wsl -l -v 

This is an exception, not like the pattern as wsl wsl -l -v

Show all of them in Command Prompt:

From PowerShell, we add two more:

PowerShell command to provide the date from the Windows file system in the green frame in the below graph:


Linux command to provide the date from the Linux file system in the red frame in the below graph:

wsl date

Show all of them in PowerShell:

6, Windows Terminal

This is Microsoft recommended:

It could be multi-tabs and panes:


Similar Articles