How to install Linux on Windows 11 with WSL for Beginners
Table of Contents
Introduction
This tutorial will guide you through the process of installing the Windows Subsystem for Linux (WSL) on your Windows 11 computer. You'll learn how to enable the necessary features, update WSL, and install Ubuntu, allowing you to enjoy a seamless Linux experience alongside your Windows environment. This guide is perfect for beginners and anyone looking to enhance their development workflow.
Step 1: Enable Windows Features
To start using WSL, you need to enable certain Windows features. Follow these steps:
-
Open Windows Features
- Search for "Turn Windows features on or off" in the Windows search bar and select it.
-
Enable Required Features
- In the Windows Features window, check the following options:
- Virtual Machine Platform
- Windows Subsystem for Linux
- Click OK to apply the changes.
- In the Windows Features window, check the following options:
-
Restart Your Computer
- After enabling the features, restart your computer to ensure the settings take effect.
Step 2: Update WSL to the Latest Version
Next, ensure that you have the latest version of WSL installed.
-
Open Windows Terminal
- Search for "Windows Terminal" in the search bar and open it.
-
Check WSL Version
- Type the following command and press Enter:
wsl --update
- This command updates WSL to the latest version available.
- Type the following command and press Enter:
-
Verify Installation
- After the update, verify that WSL is installed correctly by running:
wsl --version
- After the update, verify that WSL is installed correctly by running:
Step 3: Install Ubuntu from the Microsoft Store
Now that WSL is set up, you can install a Linux distribution like Ubuntu.
-
Open Microsoft Store
- Search for "Microsoft Store" in the search bar and open it.
-
Search for Ubuntu
- In the Microsoft Store, type "Ubuntu" in the search bar.
-
Select and Install Ubuntu
- Choose the version of Ubuntu you prefer (e.g., Ubuntu 20.04 or 22.04) and click on the Install button.
-
Launch Ubuntu
- Once installed, you can launch Ubuntu from the Start menu or directly from the Microsoft Store.
Step 4: Set Up Ubuntu
After launching Ubuntu for the first time, you will need to complete the setup process.
-
Create a User Account
- Follow the on-screen instructions to create a new user account by entering a username and password.
-
Update Ubuntu Packages
- It’s a good idea to update the package list. Run the following commands:
sudo apt update sudo apt upgrade
- It’s a good idea to update the package list. Run the following commands:
Step 5: Navigate Between Linux and Windows File Systems
You can easily access files between your Linux and Windows environments.
-
Access Windows Files in WSL
- Your Windows files are located in the
/mnt
directory. For example, to access your C drive, use:cd /mnt/c
- Your Windows files are located in the
-
Access Linux Files in Windows
- To access your Linux files from Windows, navigate to the following path in File Explorer:
\\wsl$\
- To access your Linux files from Windows, navigate to the following path in File Explorer:
Conclusion
You have successfully installed WSL and Ubuntu on your Windows 11 computer, allowing you to leverage the power of Linux alongside Windows. Remember to keep your WSL and Ubuntu installations updated regularly for the best performance. Explore your new environment, and consider diving deeper into Linux commands and tools to enhance your development experience. Happy coding!