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
Searchat the bottom of your screensearch for
Turn on Windows featuresclick
Turn on or off Windows Featuresfrom the resultsMake 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
OKto apply the changes if anyRestart the computer when the installation finishes. You can go to the next steps while the above is installing
click
Searchat the bottom of your screentype
PowerShellselect
Run as Administratorand a PowerShell terminal will open uptype
wsl --updateto make sure you have the latest version of Windows Subsystem for LinuxOpen the Microsoft Store
Search for Debian
Tip
You can use any Linux Distribution you want, Windows Subsystem for Linux installs Ubuntu by default
Click
Getto installWhen the installation is successful the computer ask yous for a
USERNAME, use something that is easy for you to remember laterNext it asks for a
PASSWORD, use something that is easy for you to remember laterAttention
the terminal does not show any text while you type your password, hit
enter/returnwhen done and it asks you to type the password again to confirm itafter installing Windows Subsystem for Linux open Visual Studio Code and install the WSL extension
Press
F1on the keyboard in Visual Studio Code and selectWSL:Connect to WSLto open a terminal in Windows Subsystem for Linuxthen type this in the terminal to update the Linux package manager
sudo apt updatetype this to upgrade Linux
sudo apt full-upgrade --yestype 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
shiftwhen your computer is restarting to enterWindows Recovery Modethen selectUEFI Firmware Settings
In BIOS mode select any variation of
System Configurationand EnableVirtualization