The integration of Linux within the Windows 10 ecosystem has opened up a world of possibilities for developers, system administrators, and tech enthusiasts alike. No longer is it a binary choice between two distinct operating systems. Windows Subsystem for Linux (WSL) provides a powerful and seamless way to run a Linux environment directly on your Windows machine, without the need for traditional virtual machines or dual-booting. This allows you to leverage the vast array of Linux command-line tools, utilities, and applications alongside your familiar Windows applications. This guide will walk you through the process, from initial setup to optimizing your Linux experience within Windows 10.

Understanding Windows Subsystem for Linux (WSL)
At its core, WSL is a compatibility layer that enables Windows to run Linux binary executables natively. It’s crucial to understand that WSL is not a virtual machine in the traditional sense. Instead, it translates Linux system calls into Windows system calls, allowing for a much more integrated and performant experience. This means you can access your Windows files from within your Linux distribution and vice-versa, and even run GUI applications with recent updates to WSL.
There are two main versions of WSL: WSL 1 and WSL 2.
WSL 1: The Original Compatibility Layer
WSL 1 translates Linux system calls to Windows NT kernel calls. This architecture provides excellent interoperability with Windows but has certain limitations, particularly in terms of performance for file-intensive operations and full system call compatibility. It’s a good starting point for many users who primarily need access to command-line tools.
WSL 2: A Full Linux Kernel for Enhanced Performance
WSL 2 utilizes a lightweight utility virtual machine that runs a real Linux kernel. This architectural change significantly improves performance, especially for file I/O, and provides full system call compatibility, meaning almost all Linux applications will run without issue. WSL 2 also offers better performance for networking operations. For most users looking to fully embrace the Linux development environment, WSL 2 is the recommended choice.
Preparing Your Windows 10 System for Installation
Before diving into the installation process, ensure your Windows 10 system meets the necessary prerequisites. A stable internet connection is required to download the necessary components.
Checking Windows 10 Version and Updates
WSL is a feature of Windows 10, and its availability and functionality can vary slightly between different versions. It is highly recommended to ensure your Windows 10 is up-to-date.
- Windows 10 Version: WSL 2 is available on Windows 10 version 1903 or later, with Build 18362 or higher for x64 systems, and version 2004 or later, with Build 19041 or higher for ARM64 systems.
- Checking Your Version: To check your Windows 10 version, press
Windows Key + R, typewinver, and press Enter. This will display a dialog box showing your current Windows version and build number. - Updating Windows: If your system is not up-to-date, navigate to
Settings > Update & Security > Windows Updateand click “Check for updates.”
Enabling Required Windows Features
Two Windows features need to be enabled for WSL to function correctly: “Windows Subsystem for Linux” and “Virtual Machine Platform.”
- Accessing Optional Features: Open the Start Menu, search for “Turn Windows features on or off,” and click on the result.
- Enabling WSL: In the “Windows Features” dialog box, scroll down and check the box next to “Windows Subsystem for Linux.”
- Enabling Virtual Machine Platform: Scroll down further and check the box next to “Virtual Machine Platform.” This is essential for WSL 2.
- Restarting Your Computer: After checking these boxes, click “OK.” Windows will install the necessary components, and you will be prompted to restart your computer. It is crucial to restart your system for these changes to take effect.
Installing a Linux Distribution
Once your system is prepared, you can proceed to install your preferred Linux distribution. Microsoft Store offers a curated selection of popular Linux distributions, making the process incredibly straightforward.
Choosing a Linux Distribution
The Microsoft Store provides access to distributions such as Ubuntu, Debian, Kali Linux, and more. For beginners, Ubuntu is often recommended due to its user-friendly interface and extensive community support.
- Ubuntu: A widely popular, stable, and user-friendly distribution.
- Debian: Known for its stability and adherence to free software principles.
- Kali Linux: A distribution focused on penetration testing and digital forensics.
- Fedora Remix: Offers cutting-edge software and technologies.
Installing from the Microsoft Store
- Open Microsoft Store: Launch the Microsoft Store application from your Start Menu.
- Search for Your Distribution: In the search bar at the top of the Store window, type the name of the Linux distribution you wish to install (e.g., “Ubuntu”).
- Select and Install: Click on the desired distribution from the search results. On the distribution’s page, click the “Get” or “Install” button.
- Launch the Distribution: Once the download and installation are complete, you can launch the distribution directly from the Microsoft Store or by searching for its name in the Start Menu.
Upon the first launch, the distribution will undergo a brief installation process, which includes setting up a default user account and password. You will be prompted to create a username and password for your Linux environment. Remember these credentials, as you will need them to access administrative privileges within Linux using the sudo command.
Configuring WSL for Optimal Performance
After successfully installing a Linux distribution, there are a few configuration steps you can take to enhance your experience and ensure WSL is operating as intended, especially if you’ve opted for WSL 2.
Setting WSL 2 as the Default Version
If you have multiple Linux distributions installed, or if you plan to install more, it’s a good practice to set WSL 2 as the default version. This ensures that any new distributions you install will automatically use WSL 2.
- Open PowerShell as Administrator: Search for “PowerShell” in the Start Menu, right-click on “Windows PowerShell,” and select “Run as administrator.”
- Set Default Version: Execute the following command:
powershell
wsl --set-default-version 2
If you encounter an error related to the kernel component, you might need to download and install the WSL2 Linux kernel update package. You can find this on the official Microsoft documentation website.
Verifying Linux Distribution Version
![]()
You can check which version of WSL your installed distributions are running on.
- Open PowerShell (Admin): As described above, open PowerShell as an administrator.
- List Installed Distributions: Run the command:
powershell
wsl --list --verbose
or the shorthand:
powershell
wsl -l -v
This command will display a list of your installed distributions, their state (Running or Stopped), and the WSL version they are using (1 or 2).
Converting Existing Distributions to WSL 2
If a distribution is currently running on WSL 1 and you wish to upgrade it to WSL 2 for better performance, you can do so.
- Open PowerShell (Admin):
- Convert the Distribution: Use the following command, replacing
[DistributionName]with the actual name of your Linux distribution (e.g.,Ubuntu):
powershell
wsl --set-version [DistributionName] 2
This process can take some time, depending on the size of your distribution and the amount of data within it.
Accessing Windows Files and Running GUI Applications
One of the significant advantages of WSL is its ability to bridge the gap between Windows and Linux environments. You can access your Windows files directly from your Linux distribution and, with recent updates, even run graphical Linux applications.
Accessing Windows File System from Linux
Your Windows drives are automatically mounted within your WSL environment. The C: drive is typically mounted under /mnt/c.
- Navigating to Windows Drives: Open your Linux terminal and use standard Linux commands to navigate. For example, to access your C: drive, you would type:
bash
cd /mnt/c
You can then navigate through your Windows directories as you normally would in Linux.
Accessing Linux File System from Windows
Conversely, you can also access your Linux files from Windows File Explorer.
- Open File Explorer:
- Type
\wsl$in the Address Bar: In the address bar of File Explorer, type\wsl$and press Enter. - Browse Your Distributions: You will see a list of your installed Linux distributions. Clicking on a distribution will allow you to browse its file system. Note: For security and stability reasons, it is generally not recommended to modify files in the Linux file system directly from Windows outside of the
/mntmount points.
Running GUI Linux Applications
WSL 2 has introduced support for running Linux GUI applications directly on Windows. This feature, often referred to as WSLg, streamlines the development workflow by allowing you to run Linux-native graphical tools without complex workarounds.
- Ensure WSLg is Supported: WSLg is automatically installed and enabled on Windows 11 and on recent builds of Windows 10 (version 21H2 and later with build 19044 or later, or version 22H2 and later with build 19045 or later).
- Install GUI Applications: Once WSL is set up, you can install graphical Linux applications using your distribution’s package manager. For example, to install the text editor
gediton Ubuntu:
bash
sudo apt update
sudo apt install gedit
- Launch GUI Applications: After installation, you can launch these applications directly from your Linux terminal by typing their command name (e.g.,
gedit). They will appear as regular Windows applications. You can also find them in your Start Menu under the name of your Linux distribution.
Essential Command-Line Tools and Workflow
With WSL installed, you gain access to a powerful command-line environment. Mastering these tools will significantly enhance your productivity.
Package Management
Each Linux distribution has its own package manager for installing, updating, and removing software.
- Debian/Ubuntu (apt):
- Update package lists:
sudo apt update - Upgrade installed packages:
sudo apt upgrade - Install a package:
sudo apt install <package_name> - Remove a package:
sudo apt remove <package_name>
- Update package lists:
- Fedora (dnf):
- Update package lists:
sudo dnf check-update - Install a package:
sudo dnf install <package_name>
- Update package lists:
Git and Version Control
Git is an indispensable tool for software development. You can install and use it directly within your WSL environment.
sudo apt update
sudo apt install git
Once installed, you can clone repositories, commit changes, and manage your projects as you would on a native Linux machine.
Docker and Containerization
WSL 2’s enhanced performance and kernel compatibility make it an excellent platform for running Docker. Docker Desktop for Windows can be configured to use the WSL 2 backend, providing a seamless containerization experience.
- Install Docker Desktop: Download and install Docker Desktop for Windows from the official Docker website.
- Enable WSL 2 Backend: During or after installation, ensure that the “Use the WSL 2 based engine” option is enabled in Docker Desktop’s settings (
Settings > General). - Run Docker Commands: You can now run Docker commands directly from your WSL terminal:
bash
docker --version
docker ps

Common Developer Workflows
WSL is widely adopted by developers for various tasks:
- Web Development: Running Node.js, Python, Ruby, PHP environments, databases like PostgreSQL and MySQL, and web servers like Nginx and Apache.
- System Administration: Using tools like
ssh,grep,awk,sed, and scripting with Bash. - Data Science: Leveraging Python libraries like NumPy, Pandas, and Scikit-learn, often with Jupyter Notebooks.
By integrating Linux tools with your Windows development environment, you gain the flexibility and power of both worlds. You can develop and test applications in a Linux-like environment while still utilizing Windows applications for other tasks, creating a highly efficient and versatile computing platform.
