Skip to main content

🐧 Windows Subsystem for Linux (WSL)

  • Alone, at your own pace

🎯 Learning Objective​

  • Learn independently using Microsoft's official documentation.
  • Install and configure WSL on Windows 11.
  • Set up VSCode for development with WSL.
  • Execute Linux commands in WSL (bash).

📜 Statement​

warning

You can use your Windows 11 virtual machine for this exercise if you do not wish to modify your main machine.

Windows Subsystem for Linux (WSL) allows you to run Linux distributions directly on Windows, without the need for a virtual machine or dual-boot. It is particularly useful for developers who want to use Linux tools while staying on Windows.

In this exercise, you will learn to install and configure WSL on Windows 11, set up Visual Studio Code for development with WSL, and execute Linux commands in WSL.

This exercise is self-paced, following Microsoft's official documentation. It is available in French and English.

Step 1: What is WSL?​

Start by reading the Overview section of the official documentation to understand what WSL is and how it works.

Step 2: Installing WSL​

Read the Install section and install WSL on your Windows 11 machine.

Step 3: Configuring WSL​

Read this guide to configure WSL and this one to set up Visual Studio Code for development with WSL.

Step 4: Create a test Python file​

In your WSL user directory, create a Python file named test.py with the following content:

print("Hello, WSL!")

Open this file in Visual Studio Code and run it using the integrated terminal in VSCode.

Step 5: Execute Linux commands​

Read the bash tutorial and practice command lines.

Practice these commands from the Windows terminal by choosing your default WSL distribution.

Step 6: Additional resources​

To better understand WSL and its advanced features, consult the sections "Concepts," "How-to," and "FAQ."

The goal is not to memorize everything but to discover the possibilities offered by WSL and know where to find the necessary information.