Edited 3 weeks ago by ExtremeHow Editorial Team
Windows 10Windows Subsystem for LinuxInstallationSystemDevelopmentFeaturesConfigurationCLIToolsSoftware
This content is available in 7 different language
Windows Subsystem for Linux (WSL) is a remarkable feature that allows you to run a Linux environment directly on Windows 10 without having to set up a virtual machine or dual boot system. It is especially useful for developers and system administrators who want to use Linux command-line tools on a Windows machine. In this comprehensive guide, we will explain the entire process of installing WSL on Windows 10 step by step. Whether you are an experienced programmer or new to Linux, this guide will help simplify the process.
Windows Subsystem for Linux (WSL) provides a compatibility layer that lets you run Linux binary executables natively on Windows. This means you can run tools like bash, utilities like grep and sed, and even software installations directly from your Windows 10 operating system. WSL is especially beneficial for developers who work on cross-platform applications or who need Linux-specific tools.
There are two versions of WSL: WSL 1 and WSL 2. WSL 2 has a full Linux kernel and offers improved performance and full system call compatibility. Our focus will be on installing WSL 2.
Before you install WSL, make sure you meet the prerequisites. Here's what you need:
The first step to turn on WSL on your system is to enable the WSL feature in Windows 10. Follow these steps:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
After enabling WSL, you may want to use WSL 2, which offers better performance. To use WSL 2, you need to configure your system as follows:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
wsl --set-default-version 2
After setting up WSL, it's time to download and install a Linux distribution. You can choose from several distributions available on the Microsoft Store such as Ubuntu, Debian, Kali Linux, and more. Follow these steps:
You can install multiple Linux distributions and even run them simultaneously using WSL. Each distribution is managed independently, providing flexibility in configuration and installed tools.
Once the Linux distribution is installed, you’ll need to perform some initial setup steps, especially if you’re setting it up for the first time:
With the Linux distribution set up, you can now execute Linux commands directly from your Windows environment. Simple commands like ls
, cd
, or touch
will work, as well as more complex commands, depending on what you install next.
To ensure that your Linux subsystem is up-to-date and able to run the applications you want, you are advised to update your Linux packages. Use the following command:
sudo apt update && sudo apt upgrade
This command will update the package repository and upgrade all the outdated packages.
You can install new applications just like you would on any Linux machine, using a package manager like apt
or yum
. For example, to install curl
tool, you could run:
sudo apt install curl
There are many ways to customize your WSL to suit your needs. Here are some suggestions:
ubuntu config --default-user yourusername
/mnt/
inside WSL. For example, to access your C:\
drive, go to /mnt/c
.If you want to completely uninstall a specific Linux distribution or WSL, you can easily do so from the Settings app or using PowerShell. Here's how:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
WSL has paved the way for seamless interaction between Windows and Linux environments, eliminating the need for complicated dual-boot setups or slow virtual machines. Through this guide, you have learned how to enable and install WSL on Windows 10, configure it for best performance, and even customize it to your needs. You should now have a complete Linux environment running smoothly alongside your Windows system, ready to tackle various development or system administrative tasks.
If you find anything wrong with the article content, you can