What Is Windows Subsystem for Linux and How It Works
Windows Subsystem for Linux, commonly called WSL, is a feature built into Windows that lets you run Linux operating systems directly on your Windows computer. Rather than using a virtual machine, which creates a separate computer environment, WSL runs Linux natively alongside Windows. This means you can use Linux tools, programs, and command-line utilities without leaving your Windows system or needing additional hardware.
Free Guide to Maryland Driver's License Requirements →
Linux is an operating system similar to Windows, but it works differently and has different tools. Many programmers, developers, and technical professionals prefer Linux for certain tasks because it offers powerful command-line tools, better support for programming languages like Python and Ruby, and access to open-source software. By using WSL, Windows users can take advantage of these Linux tools while still using Windows for everyday tasks.
There are two versions of WSL available: WSL1 and WSL2. WSL1 was the original version released in 2016. WSL2, released in 2019, offers significant improvements including faster performance, better compatibility with Linux software, and a real Linux kernel. Most users today should use WSL2 because it provides better support for modern Linux applications and runs approximately 2-6 times faster than WSL1 for many tasks, depending on what you're doing.
The way WSL2 works is different from WSL1. WSL2 uses a lightweight virtual machine that runs a real Linux kernel, which is the core of the Linux operating system. This means WSL2 can run virtually any Linux program without modification. You interact with it through a terminal window, which is a text-based interface where you type commands instead of clicking buttons with a mouse.
Practical takeaway: WSL is a Windows feature that allows you to use Linux tools on your Windows computer without major performance loss or the need for a separate computer.
System Requirements and Checking Your Computer
Before setting up WSL, you need to make sure your computer meets the necessary requirements. The good news is that most modern Windows computers can run WSL2 without problems. However, certain older systems may only support WSL1, or may not support WSL at all.
Baltimore County High School Options and Programs Guide →
For WSL2, you need Windows 10 version 1903 or later, or Windows 11 of any version. If you're running an older version of Windows 10, you'll need to update your system first. Windows Update is the built-in tool that adds new features and security updates to your computer. To check which version of Windows you have, you can press the Windows key and type "winver" then press Enter. A window will appear showing your Windows version and build number.
Your processor (also called CPU) matters as well. WSL2 requires either an Intel processor with virtualization support or an AMD processor with virtualization support. Most processors made after 2011 have this feature, but you may need to enable it in your computer's BIOS settings. BIOS is the basic system that runs before Windows starts up. You can check if virtualization is enabled by opening Windows Defender, going to Device Security, and looking for Core Isolation details.
Memory requirements are modest. You need at least 4 gigabytes (GB) of RAM to run Windows and WSL2 comfortably, though 8 GB or more is recommended if you plan to do heavy development work. Your hard drive needs at least 10 GB of free space to install a Linux distribution, though you may want more depending on what you plan to install.
If your computer doesn't meet WSL2 requirements, WSL1 is available on older Windows 10 versions going back to version 1607, though it has less functionality. Some enterprise or corporate versions of Windows may have restrictions on running WSL.
Practical takeaway: Check your Windows version, processor virtualization support, and available storage before proceeding with installation to make sure your system can run WSL2.
Installing WSL and Choosing a Linux Distribution
Installing WSL involves several steps. The first step is to enable the WSL feature in Windows. You do this by opening the Windows Control Panel, finding "Programs and Features," and clicking "Turn Windows features on or off." In the window that appears, look for "Windows Subsystem for Linux" and check the box next to it. You may also want to check "Virtual Machine Platform" to enable WSL2 specifically. After checking these boxes, click OK and your computer may ask you to restart.
Free Guide to Tax Deductions at Age 65 →
After enabling WSL, you need to set WSL2 as your default version. Open PowerShell by pressing the Windows key, typing "PowerShell," right-clicking it, and selecting "Run as administrator." In the PowerShell window, type the command: wsl --set-default-version 2 and press Enter. This ensures that any new Linux distributions you install will use WSL2.
Next, you need to choose a Linux distribution to install. A distribution is a version of Linux packaged with specific tools and software. Popular choices include Ubuntu, Debian, Fedora, and openSUSE. Ubuntu is the most beginner-friendly option and has the largest community, making it easier to find help if you encounter problems. You can install distributions through the Microsoft Store, which is an app on your Windows computer. Open the Microsoft Store, search for your chosen distribution, and click "Install."
When you run your Linux distribution for the first time, it will perform an initial setup. This typically takes a few minutes as the system unpacks files and prepares itself. You'll be asked to create a username and password for your Linux account. This username and password are separate from your Windows login and are only used within WSL. Remember these credentials, as you'll need them for administrative tasks.
You can install multiple distributions if you want to experiment with different Linux versions. Each distribution is independent and has its own file system, applications, and settings. You can manage which distribution is default using PowerShell commands like: wsl -l -v which lists all installed distributions and their versions.
Practical takeaway: Enable WSL in Windows settings, set WSL2 as default, choose a distribution from the Microsoft Store, and run through the initial setup to create your username and password.
Learning Basic Linux Commands and Navigation
Once WSL is installed, you interact with it through a terminal, which displays a command prompt. This is where you type text commands to tell the computer what to do. At first, this might feel unfamiliar if you're used to clicking buttons, but the command line is actually very powerful and efficient once you understand the basics.
Learn About Contacting Your Unemployment Claim →
The first essential command to learn is navigation. When you open your terminal, you're in a specific folder (also called a directory). To see what folder you're in, type: pwd and press Enter. pwd stands for "print working directory." To see what files and folders are in your current location, type: ls and press Enter. ls shows you a list of items. To move to a different folder, type: cd followed by the folder name. For example, cd Desktop takes you to your Desktop folder.
Creating and managing files and folders is equally important. To create a new folder, type: mkdir foldername where "foldername" is what you want to call it. To create an empty file, you can type: touch filename.txt. To see the contents of a text file, type: cat filename.txt. The cat command displays the file's contents on your screen.
Copying, moving, and deleting items also use text commands. To copy a file, type: cp originalfile copiedfile. To move or rename a file, type: mv oldname newname. To delete a file, type: rm filename. Be careful with the rm command because deleted files cannot be recovered easily.
Understanding file permissions is important for security. Every file in Linux has permissions that determine who can read, write, or execute it. The command: ls -l shows detailed information including permissions. Permissions appear as a series of letters and dashes, like "-rw-r--r--". The first dash indicates file type, the next three characters show owner permissions, the next three show group permissions, and the last three show others' permissions. r means read, w means write, and x means execute.
As you work with WSL, you'll frequently need to install software packages. Linux distributions use package managers to install software. Ubuntu uses "apt" (Advanced Package Tool). To update your package list, type: sudo apt update. The word "sudo" means "superuser do" and lets you run commands with administrator privileges. To install a program, type: sudo