How to Install WSL2 in Windows 10: A Step-by-Step Beginner’s Guide

If you want to run Linux on your Windows 10 machine without setting up a separate partition, you’re in luck! Installing WSL2 (Windows Subsystem for Linux 2) lets you do this easily. This guide will walk you through the steps to get WSL2 up and running, even if you’re not a tech wizard.

How to Install WSL2 in Windows 10

By the end of these steps, you’ll have a fully functioning WSL2 setup on your Windows 10 computer. You’ll be able to enjoy the best of both worlds—running Linux and Windows simultaneously. Ready? Let’s dive in!

Step 1: Enable the Windows Subsystem for Linux

First, you need to enable the Windows Subsystem for Linux.

Open PowerShell as an administrator and run the command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Activating this feature allows your system to run Linux distributions. It’s like opening a door between Windows and Linux.

Step 2: Enable the Virtual Machine Platform

Next, you need to enable the Virtual Machine Platform feature.

In the same PowerShell window, run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

This step sets up the necessary virtual machine services that WSL2 uses to run Linux distributions more efficiently.

Step 3: Update the WSL Kernel

Now, you need to download and install the latest WSL2 kernel update.

Visit the Microsoft WSL2 kernel update page and download the installer. Run the installer once it’s downloaded.

This update is crucial because it contains the latest improvements and features for WSL2, making sure everything runs smoothly.

Step 4: Set WSL2 as the Default Version

After installing the kernel update, set WSL2 as the default version.

Run this command in PowerShell:

wsl --set-default-version 2

This step ensures that any Linux distributions you install in the future will use WSL2 automatically.

Step 5: Install a Linux Distribution

Now, it’s time to install your preferred Linux distribution from the Microsoft Store.

Open the Microsoft Store, search for a distribution like Ubuntu, and click "Install."

Once installed, you can launch your new Linux distribution from the Start menu.

Step 6: Initial Setup

Launch your installed Linux distribution to complete the initial setup.

Follow the on-screen instructions to create a user account and password.

Your Linux environment is now set up and ready to use.

You’ve done it! After completing these steps, your system will be ready to run Linux applications alongside your Windows programs. You can switch between them effortlessly.

Tips for Installing WSL2 in Windows 10

  • Make sure your Windows 10 is updated to version 1903 or higher.
  • Use PowerShell in administrator mode to avoid permission issues.
  • Regularly check for WSL updates to keep your system up-to-date.
  • Experiment with different Linux distributions to find the one that suits you best.
  • Use WSL2 for development tasks that require Linux-specific tools and software.

Frequently Asked Questions

How do I check my Windows version?

Press Windows + R, type winver, and press Enter to see your current version.

Can I run graphical Linux applications on WSL2?

Yes, with additional configuration, you can run graphical applications.

Is WSL2 faster than WSL1?

Yes, WSL2 offers improved performance and full system call compatibility.

Can I switch back to WSL1?

Yes, use wsl --set-version 1 to revert a specific distribution back to WSL1.

Does WSL2 require a lot of system resources?

WSL2 is efficient, but having enough RAM and storage will enhance performance.

Summary

  1. Enable the Windows Subsystem for Linux.
  2. Enable the Virtual Machine Platform.
  3. Update the WSL Kernel.
  4. Set WSL2 as the default version.
  5. Install a Linux distribution.
  6. Complete the initial setup.

Conclusion

Congratulations! You’ve successfully learned how to install WSL2 in Windows 10. This setup will empower you to leverage the strengths of both Windows and Linux. Whether you’re a developer or just curious about Linux, WSL2 provides a seamless and efficient way to run Linux apps on your Windows machine.

Remember, technology constantly evolves, and staying updated is key. Keep an eye out for new features and patches from Microsoft to enhance your WSL2 experience. If you’re eager to dive deeper, explore the various Linux distributions available and see which one fits your needs best.

Happy computing, and enjoy your new dual-OS setup!