Let’s look at WSL, the Windows Subsystem for Linux. It allows you to run Linux on Windows. It even integrates tightly with Windows. You’ll discover that it’s truly awesome. In fact, it’s the reason many developers are embracing Microsoft Windows again!
In this article, you’ll install WSL, set up Python inside it, and connect Visual Studio Code to it, so you can write Python on Windows while it runs on Linux.
The new Microsoft?
For years, developers who liked Linux had to choose: dual boot, run a bulky virtual machine, or buy a Mac. What changed is Microsoft’s attitude towards open-source software and the open-source ecosystem as a whole. Instead of seeing Linux as a threat, Microsoft has embraced it. And instead of reducing command-line usage to a minimum, Microsoft created both PowerShell and Windows Terminal to help us developers get stuff done without a GUI. WSL itself has been open source since 2025.
Instead of seeing Linux as a threat, Microsoft has embraced it
Windows WSL: Windows Subsystem for Linux
The first version of WSL worked by translating Linux kernel calls to Windows calls. With WSL2, which is the default now, you’re running a real Linux kernel through a very thin virtualization layer. In fact, even Windows is running through that same hypervisor. So Linux becomes a first-class citizen on your system, sharing system resources with Windows.
Without going into all the details, I’ll just tell you the result: you can open a full-blown Linux terminal in seconds and start entering Linux commands or creating Bash scripts as usual. Several distributions are available, like Ubuntu, Debian, Kali, and openSUSE.
You can open a full-blown Linux terminal in seconds
Thanks to Windows WSL, you no longer need a separate Linux partition, a bulky VM, or a second PC. You can run multiple Linux distributions right on your Windows desktop. And the best news is that it integrates very well with Windows and Visual Studio Code! For example, you can:
- Access your Linux files from Windows Explorer, e.g.
\\wsl.localhost\Ubuntu\home\(the older\\wsl$\Ubuntu\works too) - Access your Windows files from Linux, e.g.
/mnt/c/Users/ - Copy-paste text between Linux and Windows
- Run Linux GUI apps, which open in a normal window on your Windows desktop
- Connect VS Code, running under Windows, to the Linux environment
How to install WSL
On Windows 11, or Windows 10 version 2004 and later, installing WSL is a single command. Open PowerShell as administrator (right-click it and choose “Run as administrator”) and enter:
wsl --install
This enables the required Windows features and installs Ubuntu. Restart your computer when it asks you to. The first time you start Ubuntu, from the Start menu or by typing wsl in a terminal, it asks you to pick a Linux username and password. These are separate from your Windows account.
Prefer another distribution? wsl --list --online shows what’s available, and wsl --install -d Debian installs, in this case, Debian. Microsoft’s page on how to install WSL has the details and covers older Windows versions.
One tip: keep your projects inside the Linux file system, for example in your Linux home directory, and not under /mnt/c/. Linux tools are much faster on their own file system.
Install Python inside WSL
Ubuntu already includes Python 3. Open your WSL terminal and check the version with python3 --version. To get the python command, virtual environments and pip as well, install these packages:
$ sudo apt update $ sudo apt install python3 python-is-python3 python3-venv python3-pip
Ubuntu’s Python is often a version behind the latest release, which is fine for most work. If you want the newest Python, or several versions side by side, install uv inside WSL and let it install Python for you:
$ curl -LsSf https://astral.sh/uv/install.sh | sh $ uv python install 3.15
Everything else works as on any Linux machine. See installing Python on Linux for more options. Don’t use sudo pip install to install packages; use a virtual environment instead.
Visual Studio Code
Visual Studio Code is a free IDE from Microsoft, available on all the major platforms, and it has excellent integration with WSL. Install VS Code on the Windows side, not inside Linux, and add the WSL extension. Then, in your WSL terminal, go to a project directory and enter:
$ code .
You can also give it a directory, like code my-project-dir/. The first time, VS Code downloads a few components into WSL. After that, VS Code will:
- start a server on Linux,
- open VS Code on Windows in a regular window,
- connect to the server inside the WSL Linux environment.
You’re running VS Code natively on Windows, but you’re working in a Linux environment! If you open a terminal inside VS Code, it will be a Linux shell running in WSL. If you hit run, your Python code runs on Linux, with the Python you installed in WSL. Extensions like the Python extension are installed on the WSL side, so VS Code will offer to install them there the first time.
Docker Desktop and Kubernetes
Docker Desktop for Windows integrates with WSL2 too. If you want to containerize your Python projects, WSL is here to make your life easier.

Because Windows now has a full-fledged Linux environment, Docker runs its containers inside Linux. That makes the Docker daemon start much faster than it did with the old Hyper-V virtual machine, and it manages CPU and memory better.
Another big advantage is that you can start Docker containers from both Windows and Linux. They will end up running in the same Docker daemon. In fact, you don’t even need to install Docker inside your Linux installation since Docker Desktop takes care of it. See Docker’s page on the WSL 2 backend for the setup.

Docker Desktop, optionally, integrates Kubernetes into the installation as well. It can be enabled from the settings page, in which case a single-node cluster is started and accessible from both Windows and Linux.
The bottom line
Windows WSL has many Linux-minded developers covered these days, offering us:
- A stable desktop, with good hardware support
- A Linux environment to work on all kinds of projects that will end up on cloud machines, Docker containers, etcetera
- A terrific and free IDE (Visual Studio Code) with extensions for basically anything you can think of
- Awesome Docker Desktop integration
It’s how I work myself: Windows for the hardware support, and Linux for development, which is, in my opinion, the best platform for Python.