How to Enable and Configure WSL (Windows Subsystem for Linux) on Windows 11
WSL (Windows Subsystem for Linux) is a built-in feature in Windows 11 that lets you run Linux command-line tools and apps alongside your normal Windows programs. It runs a full Linux environment inside Windows 11 and uses far less memory than a traditional virtual machine, so you do not need to set one up.
Setup takes a few minutes in PowerShell and gives you access to popular Linux tools, programming languages, and file systems. Windows usually needs one restart the first time the WSL features are turned on, so save your work before you begin. WSL works on both Windows 11 Home and Pro.
Open Windows PowerShell as an administrator, type wsl –install, press Enter, and restart your computer to enable and configure the Windows Subsystem for Linux on Windows 11. This single command turns on the required system features, downloads the default Linux environment, and gets your setup ready to use.
What is the Windows Subsystem for Linux (WSL)?
Windows Subsystem for Linux (WSL) is a built-in Windows 11 feature that lets you run real Linux software on your PC without a separate virtual machine. It sits between Windows and Linux, so you can use command-line tools, scripts, and open-source applications next to your regular Windows apps.
With WSL you open a terminal window and run genuine Linux commands and scripts. You can also use languages and tools such as Python, Node.js, and Docker. You do not need to install heavy virtual machine software or manage a separate virtual disk by hand. Your Linux files are also reachable from Windows File Explorer , so you can edit code in a Windows editor and run it in Linux.
The current version, WSL 2, uses a real Linux kernel that Microsoft builds and ships with Windows. That gives you good file performance inside Linux and full system call compatibility, which means more Linux software runs correctly. If you want to learn programming, test websites, or run developer tools that expect Linux, WSL is a practical way to do it without leaving Windows.
Prerequisites for Running WSL on 🪟 Windows 11
To run WSL on Windows 11 you need a PC running Windows 11 version 21H2 or higher, with hardware virtualization turned on in the BIOS or UEFI settings. Most computers sold in recent years meet these requirements, but it takes only a minute to check.
First, check your Windows version:
- Press the Windows Key, type About your PC, and press Enter. You can also go to Settings System About
- Scroll to the Windows specifications section. You should see an edition (Home or Pro, for example) and a version number such as 21H2 or later.
Second, your processor must have hardware virtualization turned on. This is a setting in the processor that lets the computer run more than one operating system at the same time. Most modern PCs ship with it enabled. To check, open Task Manager, go to the Performance tab, and select CPU. Look for Virtualization in the lower right. It should say Enabled.
If it says Disabled, or you get a virtualization error during setup, restart the PC and enter the BIOS or UEFI menu. The key to press varies by manufacturer, and it is often Delete, F2, or F10. The option is usually called Intel Virtualization Technology (VT-x) on Intel systems or SVM Mode on AMD systems. The exact wording and location differ between makers, so check your PC or motherboard manual if you cannot find it. Turn it on, save, and exit. To undo this, go back into the same menu and turn it off.
How to Enable and Install WSL on 🪟 Windows 11
Installing WSL on Windows 11 takes far fewer steps than it once did. Microsoft provides a single command that turns on the required Windows features and downloads a Linux distribution for you.
Method 1The Quick Install Command
Installing WSL with one command in PowerShell is the fastest method for most people. You open PowerShell with administrator rights, run the install command, and let Windows download and configure the files it needs. You need an internet connection and an administrator account.
- Press the Windows Key on your keyboard.
- Type PowerShell in the search bar. Windows PowerShell should appear at the top of the results.
- Right-click Windows PowerShell and choose Run as administrator. In Windows 11 you can also select it and click Run as administrator in the pane on the right.
- When the User Account Control prompt asks if you want to allow this app to make changes to your device, click Yes. A blue PowerShell window opens, and its title bar should say Administrator.
- Type the exact command into the window:Code
wsl --install - Press Enter to run it. Text appears showing the progress of the downloads.
- Wait while Windows downloads the files and turns on the required features. This can take several minutes, depending on your connection.
- Restart your computer when the installation finishes so all changes take effect. After the restart, the Linux distribution may open a window on its own and finish setting up. It then asks you to create a username and password. The password does not show any characters as you type it. That is normal.
If you see an error about virtualization, go back to the prerequisites and check that it is turned on in your BIOS or UEFI settings.
Method 2Turning on Windows Features Manually
Enabling the Windows features manually lets you set up the subsystem through a graphical window instead of typing commands. You open the Windows Features window, check the boxes for virtual machine support and Linux support, and restart your computer. This is useful if you prefer menus or if you cannot use PowerShell. Note that this only turns on the features. You still need to add a Linux distribution afterwards, as described in the next section.
- Press the Windows Key, type Turn Windows features on or off, and press Enter. You need administrator rights, and Windows may ask for confirmation.
- A small Windows Features window appears with a long list of checkboxes. Scroll down to Virtual Machine Platform and check the box next to it.
- Scroll further to Windows Subsystem for Linux and check that box as well.
- Click OK at the bottom of the window. Windows searches for the files and applies the changes, and a progress bar appears.
- When it finishes, click Restart now to reboot your computer. You should return to the desktop with both features active.
To undo this, open the same window, clear both checkboxes, click OK, and restart.
Choosing and Installing a Linux Distribution
Choosing a Linux distribution means picking a specific flavor of Linux to run on your Windows computer, such as Ubuntu, Debian, or Fedora. Ubuntu is installed by default with the main setup command. You can pick a different one depending on the tools or software you plan to use. Ubuntu is a good first choice because most tutorials and documentation assume it.
By default, the wsl --install command usually installs Ubuntu. If you want a different distribution, or more than one, you can add them from the Microsoft Store or from the command line.
- Open the Microsoft Store from the Start menu.
- Search for the distribution by name, for example Debian, and open its page.
- Click Get or Install, and wait for the download to finish.
- Click Open, or find the new entry in the Start menu. The first launch takes a minute while Linux unpacks, and then it asks you to create a username and password for that distribution.
Each distribution has its own separate username, password, and files, so you can install several and keep them apart. To remove one you no longer need, uninstall it like any other app in Settings Apps Installed apps
Installing via the Microsoft Store
Installing Linux distributions via the Microsoft Store is a simple way to add environments like Ubuntu to your Windows 11 computer. You open the store app, search for your preferred Linux version, and click the install button to download it directly to your machine without using the command line.- Open the Microsoft Store app from your Windows start menu or taskbar.
- Type Linux or the name of the specific distribution you want (such as Ubuntu) into the search bar.
- Click on the distribution you want to install.
- Click the Get or Install button. The Microsoft Store will download and install the Linux system for you.
Setting Up Your Linux User Account
Setting up your Linux user account in WSL happens the very first time you launch your new distribution after installation. The terminal asks you to type a simple lowercase username and create a secure password to protect your files and manage administrative tasks on the system.
- Type a new username (usually your first name or a simple handle) and press Enter. Note that your username must use lowercase letters.
- Type a secure password and press Enter. As you type your password, no characters or dots will appear on the screen. This is a normal security feature in Linux to keep your password hidden from prying eyes. Just type your password carefully and press Enter.
- Retype the same password to confirm it and press Enter.
Once your account is created, you will see a command prompt welcoming you to your new Linux environment. You are now ready to run Linux commands!
How to Check Your WSL Version and Upgrade to WSL 2
It is important to make sure your Linux distributions are running WSL 2, which is much faster and offers full system compatibility compared to the older WSL 1.
Checking Your Current Version
You can easily check which version of WSL your installed Linux distributions are using.
- Open Windows PowerShell or the Command Prompt.
- Type the command:Code
wsl -l -v - Press Enter.
A list will appear showing your installed Linux distributions and the version number (1 or 2) next to each one.
Upgrading from WSL 1 to WSL 2
Upgrading from WSL 1 to WSL 2 gives you better performance, complete system call compatibility, and faster file speeds using a quick command in PowerShell. You open PowerShell as an administrator, target your specific Linux distribution name, and run the version update command to finish the process.
- Open Windows PowerShell as an administrator. [Requires administrator privileges]
- Type the command, replacing
DISTRO-NAMEwith the actual name of your Linux distribution (for example,Ubuntu):Codewsl --set-version DISTRO-NAME 2 - Press Enter.
Wait for the conversion process to finish. This may take a few minutes depending on how many files you have in your Linux system.
You can set Windows Subsystem for Linux version 2 as your default setting for all future Linux installations so that new setups automatically use the best performance and compatibility. To do this, you just need to open your command prompt and run the command `wsl --set-default-version 2`. Setting this default saves you time because you will not need to upgrade every new Linux distribution manually after you download it from the Microsoft Store.
Managing multiple Linux distributions in WSL (Windows Subsystem for Linux) allows you to install and run up to 32 different versions of Linux on the same Windows 11 computer at the same time. You can view all your installed Linux environments, switch between the environments easily, and use separate Linux systems for different coding projects or testing tasks.
To see all the Linux distributions currently installed on your computer, open PowerShell and type:
wsl --list --allIf you have more than one distribution installed, Windows chooses one as your default. When you open WSL from your start menu, it opens your default distribution. You can change your default distribution by running this command in PowerShell:
wsl --set-default DISTRO-NAMEReplace DISTRO-NAME with the exact name of the distribution you want to use as your main system.
Advanced Configuration: Managing WSL Settings with .wslconfig
Configuring advanced Windows Subsystem for Linux settings with a .wslconfig file lets you control how much computer memory, processor power, and hard drive space the Linux subsystem can use. By creating this simple text file in your Windows user folder, you can set global resource limits to keep your computer running smoothly.
The .wslconfig file applies settings globally to all Linux distributions running on your computer. Here is how to set it up:
- Open your standard Windows Notepad application.
- Copy and paste the sample settings into Notepad:Code
memory=4GB
processors=2
swap=2GB
localhostForwarding=true - Click File and then Save As.
- Navigate to your main Windows user folder (usually located at
C:\Users\USERNAME). - Name the file exactly
.wslconfig(make sure to include the dot at the beginning) and set the save type to All Files (*.*). - Click Save.
These settings limit WSL to using 4 gigabytes of memory and 2 processor cores, ensuring your Windows computer stays fast and responsive while you run Linux tools.
Expert Tips for Getting the Most Out of WSL
Now that your WSL environment is running smoothly, here are a few expert tips to help you work faster and smarter on Windows 11.
Accessing Windows Files from Linux
Accessing Windows files from Linux inside WSL is automatic because the subsystem mounts your Windows hard drives directly within the Linux file system. You can easily find and open your documents and project files without having to copy them back and forth between the two operating systems.
If your project files are saved in your Windows Documents folder, you can access your project files in Linux by typing cd /mnt/c/Users/YourUsername/Documents in the Linux terminal. Accessing Windows files from Linux matters because you can edit your code using Linux tools without making copies of your files.
cd /mnt/c/Users/USERNAME/DocumentsAccessing Linux Files from Windows
You can also browse your Linux files directly from the Windows File Explorer. Open File Explorer and click on the Linux icon located in the left sidebar. From there, you can click into your installed distributions and view, edit, or copy files using familiar Windows apps.
Using Visual Studio Code with WSL
Using Visual Studio Code with WSL lets you edit code files stored directly inside your Linux environment while enjoying the comfort of the Windows desktop application. You open your Linux terminal, go to your project folder, and type a simple command to launch a fully connected editor window.
code .This command installs a small helper server in Linux and opens a Visual Studio Code window on your Windows desktop that is fully connected to your Linux system.
Summary
This complete tutorial explains how to enable, install, and configure the Windows Subsystem for Linux (WSL) on Windows 11 so you can run Linux tools alongside your normal apps. You learned how to turn on the feature, install distributions like Ubuntu, upgrade to WSL 2, manage files, and adjust advanced settings.
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!