how to install Windows Subsystem for Linux on Windows

This is one way to install Windows Subsystem for Linux on a Windows computer so you can use Linux on your Windows computer. It gives you more control, and your programming experience will be the same as mine in the book


Make sure your computer runs Windows 11. If you cannot upgrade to Windows 11, still try the steps below, if they do not work skip to how to make a python test driven development environment on Windows without Windows Subsystem for Linux

As of October 14th, 2025, Microsoft stopped supporting Windows 10, Windows 8.1 and Windows 7

  • click Search at the bottom of your screen

  • search for Turn on Windows features

  • click Turn on or off Windows Features from the results

  • Make sure the following have check marks to the left of them in the dialog box that opens up

    • Hyper V (this might not be in the list, you can skip it if it is not)

    • Virtual Machine Platform

    • Windows Subsystem for Linux

    • Windows Hypervisor Platform

    Click OK to apply the changes if any

  • Restart the computer when the installation finishes. You can go to the next steps while the above is installing

  • click Search at the bottom of your screen

  • type PowerShell

  • select Run as Administrator and a PowerShell terminal will open up

  • type wsl --update to make sure you have the latest version of Windows Subsystem for Linux

  • Open the Microsoft Store

  • Search for Debian

    Debian in Microsoft Store

    Tip

    You can use any Linux Distribution you want, Windows Subsystem for Linux installs Ubuntu by default

  • Click Get to install

  • When the installation is successful the computer ask yous for a USERNAME, use something that is easy for you to remember later

  • Next it asks for a PASSWORD, use something that is easy for you to remember later

    Attention

    the terminal does not show any text while you type your password, hit enter/return when done and it asks you to type the password again to confirm it

  • after installing Windows Subsystem for Linux open Visual Studio Code and install the WSL extension

  • Press F1 on the keyboard in Visual Studio Code and select WSL:Connect to WSL to open a terminal in Windows Subsystem for Linux

  • then type this in the terminal to update the Linux package manager

    sudo apt update
    
  • type this to upgrade Linux

    sudo apt full-upgrade --yes
    
  • type this in the terminal to install Python

    sudo apt install python3 python3-venv --yes
    

you can continue with how to manually make a python test driven development environment.

If installing Windows Subsystem for Linux does not work, you can use how to make a python test driven development environment on Windows without Windows Subsystem for Linux instead

Note

In some cases your Windows Subsystem for Linux installation might succeed and you will have errors with Debian, you might have to enable virtualization from your BIOS, here’s how to do that

  • restart your computer

  • as soon as it restarts, press the key to enter setup mode, this varies by manufacturer but is one of the following

    • Esc

    • F2

    • F10

    • F12

    • Alternately you can hold shift when your computer is restarting to enter Windows Recovery Mode then select UEFI Firmware Settings

  • In BIOS mode select any variation of System Configuration and Enable Virtualization