- Learn how to install, configure, and manage multiple distributions Linux en Windows 11 with WSL 2 safely and efficiently.
- Learn how the commands main, combination of Linux/Windows tools, user management and system update.
- Learn the real differences between WSL 1, WSL 2, virtual machines, and dual boot, and when to take advantage of each technology.
Would you like to have a fully functional Linux environment on your Windows 11 computer without having to deal with virtual machines, partitions, or long reboots? Thanks to WSL 2, Microsoft has made it possible for users of all skill levels to enjoy the power of Linux within Windows in the simplest and most secure way. No arguments, no data loss, and all the fear that sometimes comes with "touching the system."
In this comprehensive guide, you'll discover all the possibilities of WSL 2, from initial installation and configuration to the most advanced commands to get the most out of it. Let's go through the shortcuts together, Tricks and tips that don't always appear in the official documentation, as well as the most common errors, differences between versions, and how to combine the best of both systems in your daily life, regardless of your profile.
What is WSL 2 and why is everyone talking about it?
WSL (Windows Subsystem for Linux) is a feature built into Windows 11 and recent versions of Windows 10 that allows you to install and run Linux distributions as if they were native applications within Windows.. So, you can open Ubuntu, Debian, Kali, Fedora, Arch or Alpine directly from the boot menu or from Windows Bus Terminal and use its commands, package managers, and utilities as if you were on a “real” Linux installation.
The main advantage? You don't need to set up complicated virtual machines or dual boot.Forget about rebooting every time you want to switch systems or wasting disk space unnecessarily. WSL 2 also uses a lightweight Hyper-V-based virtual machine and a real Linux kernel, giving it ultra-high performance and compatibility, even allowing you to run graphical applications or advanced disk mounts.
With WSL 2 you can not only have multiple Linux distributions running independently, but both can interact with the Windows file system and vice versa.The result is a hybrid experience perfect for developers, system administrators, the curious, or anyone who wants to learn Linux from the comfort of a Windows environment.
Advantages and limitations of WSL 2 compared to other alternatives
If you're still wondering whether it's worth using WSL 2 on Windows 11 (or Windows 10 from certain versions onwards), here's a quick look at its most relevant strengths and limitations.:
- quick installation: You can have your Linux up and running in minutes.
- No need to reboot, nor make drastic changes to your hard drive.
- Light and efficient: It barely consumes any resources compared to virtual machines and only “works” when you need it to.
- Full integration with Windows: You can access files between both systems, run commands from one to the other, and even use GUI applications thanks to the latest updates.
- Ideal for development, scripting, Linux learning, and system administration at the consumer and professional level.
- Official support for several distributions (Ubuntu, Debian, Kali, Alpine, Fedora, Suse… and growing).
Limitations? Although they are becoming fewer and fewer, WSL 2 does not replace a full virtual machine for certain production tasks, servers, or software that relies on systemd. (although there is already initial support). Access to hardware Network performance may be limited and raw performance is very high for typical use but not identical to a native installation.
Requirements and pre-checks before installing WSL 2
Before we launch into installing WSL 2 you should check that your computer meets some minimum requirements:
- Windows 11 (any desktop edition) or Windows 10 version 2004, build 19041 or later.
- x64 processor (for ARM64 you need build 19041 or higher and updated Windows).
- Virtualization enabled in BIOS (very important, go into your board's configuration and activate Intel VT-x or AMD-V).
- Access an administrator account in Windows to enable optional features.
To find out your version of Windows, click Windows + R, writes winver and confirm. If you see a version lower than 2004, you'll need to update from the settings menu or using the Microsoft Update Assistant.
Virtualization enabled? You can also easily check by looking at the Task Manager – Performance tab – CPU. If you see “Virtualization: Enabled,” you’re good to go. If not, you’ll need to reboot, enter the BIOS, and change it there.
How to install WSL 2 step by step and choose your favorite distribution

Installing WSL 2 on Windows 11 (or modern versions of Windows 10) can be done in several ways, but the easiest is from PowerShell or Symbol of the system (CMD) with a single command:
- Opens PowerShell as administrator (right-click on the Start icon > Windows PowerShell (Admin)).
- Run wsl -install to install the latest version of WSL alongside Ubuntu as the default distribution.
The command wsl -install performs several steps automatically:
- Enables the required WSL and virtual machine platform components.
- Download the latest Linux kernel.
- Set WSL 2 as default.
- Installs a Linux distribution (usually Ubuntu) by default.
When the process is complete, Windows may prompt you to restart your computer. Do this to ensure everything is applied correctly.
Want to install a different distribution? Simple: run wsl –list –online to see all the distributions available in the Microsoft Store (Debian, Kali, Alpine, Fedora, openSUSE, etc.). You can then install your preferred one with: wsl –install -d DISTRIBUTION_NAMEExample to install Kali: wsl –install -d Kali-Linux.
From the Microsoft Store, you can also search for "Linux," choose the one you want, and install it like any other app.
First steps after installing WSL 2: username, password, and basic configuration
When launching the distribution (from the start menu or by typing ubuntu, debian, etc.) for the first time, you will need to define a unique username and password for your Linux environmentThis user will be the one with administrator permissions (sudo). If you want to learn how to manage permissions, you can check out How to manage permissions in Linux.
Forgot your Linux password in WSL 2? You can reset it from PowerShell like this:
- Open PowerShell as administrator.
- Launches the distribution as root with: wsl -u root o wsl -d Debian -u root (changing Debian for your distribution).
- Usa passwd USERNAME to set a new password.
- Write exit to log out of root and return to your user.
Update and customize your Linux environment in WSL 2
As with any Linux system, It is essential to update the packages and the system as soon as you install it.. For Debian/Ubuntu based distributions:
sudo apt update && sudo apt upgrade
This way, you'll have a secure and up-to-date Linux environment. If you're using another distribution, use the corresponding package manager. You can also learn how to discover the format of a file to better manage your resources.
You can store projects in the Linux own path (\\wsl$\DistroName\home\UserName\Project) for optimal performance and to access the Windows desktop from Linux with explorer.exe . (the period is essential to open the current directory).
Essential basic commands for managing WSL 2 and your distributions
WSL 2 offers an extensive list of commands for both novice and advanced users.Let's break down everything you need to master your environment from the start:
- wsl –list –online: Lists all Linux distributions available for installation from the Store.
- wsl --list --verbose o wsl -l -v: Displays installed distributions, their status (running, stopped), and WSL version (1 or 2).
- wsl –install -d DISTRIBUTION_NAME: Installs the specific distribution (example: wsl –install -d Ubuntu).
- wsl --set-default-version 2: Sets WSL 2 as the default version for future installations.
- wsl –set-version DISTRIBUTION_NAME 2: : Updates the indicated distribution to WSL 2 (you can enter 1 to return to WSL 1).
- wsl –set-default DISTRIBUTION_NAME: Sets a layout as default for wsl commands.
- wsl –distribution DISTRIBUTION_NAME –user USER: Runs a specific distribution with a specific user.
- wsl-update: Updates WSL itself and its kernel.
- wsl –status: Displays the current WSL configuration, distribution, and kernel version.
- wsl –shutdown: Shuts down all running distributions and the WSL 2 VM, useful after large changes.
- wsl –terminate DISTRIBUTION_NAME: Stops a specific WSL distribution.
- wsl –export DISTRIBUTION_NAME FILE.tar: Exports an entire distribution as a tar or vhdx file (for backup or migration).
- wsl –import DISTRIBUTION_NAME INSTALL_PATH FILE.tar: Import a custom distribution from a tar/vhdx file.
- wsl –unregister DISTRIBUTION_NAME: Completely deletes a WSL distribution (be careful, everything is lost!).
- wsl –mount DISK_PATH: Allows you to mount physical disks, partitions, or vhdx files in WSL 2.
- wsl –unmount DISK_PATH: Unmounts a previously mounted disk or partition.
These commands can be used in both PowerShell and CMD, and many have shorthand forms (-l -v instead of –list –verbose, for example).
Key differences between WSL 1, WSL 2, virtual machines, dual boot, and Docker
Knowing the differences between WSL 1 and WSL 2 is essential to know when to use each one.:
- WSL 1: Pretty fast, but it doesn't run a real Linux kernel, so some programs (like Docker or those that require systemd) don't work or work in a limited way.
- WSL 2: It uses a lightweight virtual machine with a real Linux kernel (based on Hyper-V), which gives greater compatibility (Docker, systemd, disk access, etc.) and better I/O performance, although accessing Windows files from Linux is slower than the other way around.
Compared to a traditional virtual machine:
- Virtual machines (VirtualBox, VMware) completely isolate the Linux system, require more resources, boot more slowly, and do not integrate Windows file access and commands as well.
- WSL 2 integrates and shares resources efficiently, running only when you need it and allowing you to run both systems simultaneously, ideal for development and testing.
Compared to Dual Boot:
- El Boot Dual requires partitioning, reboots, and having both systems separate. WSL 2 avoids this, giving immediate access to both platforms.
Comparing with Docker:
- Docker creates isolated containers on top of Linux (or WSL 2 on Windows 11), not giving you a full Linux environment but a minimal one to run services.
- WSL 2 can serve as a foundation for Docker Desktop, optimizing the combined use of both.
Add new distributions, change the default, and advanced management
You can have as many Linux distributions as you want installed on your computer at the same time, completely independent.To see them, run:
wsl --list --verbose
To switch from one to the other, simply run it from the start menu, Windows Terminal or with wsl -d DISTRIBUTION_NAME.
Want to set a different one as the default? Do it like this:
wsl –set-default DISTRIBUTION_NAME
If you need to create, restore, or migrate distributions between computers, use the following commands: to export e to import:
- wsl –export dist_name file.tar: Create a complete backup in tar or vhdx format.
- wsl –import dist_name path file.tar: Restore (or clone) that distribution to another location or PC.
Mounting disks and accessing file systems between Windows and Linux
One of the most powerful features of WSL 2 is the ability to mount physical disks, USB drives, or virtual disk (vhdx) files, and access file systems not supported by Windows, such as ext4.. For this, you can consult How to access Linux partitions from Windows.
To mount a disk:
wsl –mount DISK_PATH
You can specify file system type (–type ext4, –vhd for virtual disk images, –partition NUMBER for a specific partition, etc.). To see what devices you have: list of USB devices in Linux.
To disassemble:
wsl –unmount DISK_PATH
Make sure you have no files open before unmounting to avoid errors.
Linux and Windows Command Integration: How to Get the Most Out of It
One of the most spectacular things about WSL 2 is interoperability:
- From Windows you can run Linux commands: wsl ls -la shows you the contents of the Windows directory using Linux's 'ls'.
- Combine commands from both systems: wsl ls -la | findstr "git" search the Linux listing using the Windows filter.
- Conversely, you can use Windows utilities on Linux by simply adding .exe to command: notepad.exe file.txt open your Windows editor from the Linux terminal.
- You can even open File Explorer. explorer.exe . from the Linux terminal and navigate the current folder graphically.
If you want to know your IP address within WSL 2 (different from Windows):
- For Linux virtual machine IP: wsl hostname -I
- To view Windows IP from WSL: ip route show | grep -i default | awk '{ print $3}'
User Management: Change default user and run as root
By default, the user created the first time you run a new distribution will be the one with administrator permissions (sudo). If you need to change this because you've created another user, want to run as root temporarily, or have forgotten your password, you can do so as follows:
- wsl –user USERNAME: runs the distribution with the specified user, useful for administration tasks.
- distro_name config –default-user USERNAME: Changes the permanent default user for that distribution. Example: ubuntu config –default-user maria
Remember that each distribution has its own list of users and passwords, separate from the Windows user.
Updating and maintaining WSL 2 and Linux distributions
WSL 2 is constantly being updated, especially as Microsoft adds new features and fixes integration bugs. To keep everything up to date:
- wsl-update: updates the subsystem itself and its kernel (you can force the download from Github with –web-download).
- Within each distribution, update the system as you would on any Linux: sudo apt update && sudo apt upgrade (or the appropriate command depending on your distro).
Microsoft does not automatically update Linux distributions; this is the user's responsibility.
Useful Linux commands and tricks for each distribution with WSL 2
Aside from the WSL commands, all distributions function like a “real” Linux installation.
- ls: Lists files and folders.
- cd: Change directory.
- pwd: Displays the current route.
- cat file.txt: Shows the content of a text file.
- sudo apt install package: Install a program on Debian/Ubuntu.
- dpkg -l: Shows installed packages (useful for development).
- uname -a: : Check the installed Linux kernel and version.
- mount: Check mounted file systems.
- ifconfig o thread a: Query network interfaces.
To access the Windows file system from Linux, use the path /mnt/c/ (or the appropriate drive letter). For example, to view your Windows documents: cd /mnt/c/Users/YourUsuario/Documents
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.