Skip to Content

How Can You Easily Build Windows Subsystem for Linux (WSL) from Source?

Why Is Building WSL from Source So Satisfying for Windows Users?

Building Windows Subsystem for Linux from source makes you part of the new way Microsoft supports open software. You get to see how it all works, learn, and maybe even help the community. Here’s how to do it, using simple clear steps.

Getting Ready

First, make sure your computer has what WSL needs:

  • Windows 11 (best for these instructions).
  • Developer mode turned on: Go to Settings > System > For Developers and turn it on.

Tip: Use an “Administrator” or “Run as administrator” terminal window to skip permission problems.

Step 1: Install What You Need

Visual Studio 2022

Get Visual Studio Community 2022 (or Pro/Enterprise if you have those). This helps your computer understand and build the code.

During setup, check these boxes:

  • .NET desktop development
  • Windows 11 SDK (look for something like 10.0.26100.x)
  • MSBuild
  • MSVC v143 – C++ build tools (x64/x86, latest)
  • MSVC v143 – C++ Spectre libs
  • C++ ATL (both normal and Spectre)
  • C++ Clang Compiler for Windows
  • .NET WinUI app development tools

For ARM builds, pick ARM-specific options too.

CMake

This tool organizes the build process. Install with one simple command:

winget install kitware.cmake

Git

Git grabs the latest source code for you. Install Git with:

winget install git.git

Step 2: Get the WSL Source Code

Open Terminal or PowerShell.

Download (clone) the code:

git clone https://github.com/microsoft/WSL.git
cd WSL

Now you have all the code on your computer.

Step 3: Make Code Changes (if you want)

Open code files with your favorite editor. Change anything you wish.

Example: Change the help menu by editing .localization\strings\en-US\Resources.resw.

Step 4: Prepare the Build

Back in the WSL code folder, generate build files:

cmake . -DCMAKE_BUILD_TYPE=Release -B .\build\

-DCMAKE_BUILD_TYPE=Release: Builds the fastest version.

-B .\build\: Keeps new files tidy in the “build” folder.

Step 5: Build WSL

Still in the terminal, type:

cmake --build .\build --config Release

This makes the WSL installer for you. When done, look in .build\bin\x64\Release for wsl.msi.

Step 6: Install Your Version of WSL

Double-click wsl.msi to install or upgrade.

Or, use PowerShell:

Start-Process msiexec.exe -ArgumentList '/i build\bin\x64\Release\wsl.msi'

Check your version:

wsl --version

Step 7: See Your Changes

Type:

wsl --help

You’ll see your edits (if you made any) in action.

Why This Makes You Happy

  • You control the code—customize for your needs.
  • Learn more about WSL, C++, and builds.
  • Join the open-source community.
  • Enjoy real pride seeing your own WSL in action.

WSL being open source means everyone can inspect, tinker, and suggest improvements. The code, updates, and more information are always available on the official GitHub and Microsoft’s learning hub.

This process offers a satisfying way to own your tools and see positive results from your effort.