Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Windows Subsystem Linux Setup Guide for Beginners

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If you're looking to run Linux natively within Windows, the Windows Subsystem for Linux (WSL) offers a seamless way to do so. Whether you're a developer, sysadmin, or hobbyist, setting up WSL allows you to access Linux tools, scripts, and environments directly on your Windows machine without the need for dual-booting or virtual machines. This guide will walk you through the process step-by-step, ensuring you get your Linux environment up and running efficiently. Before starting, ensure your Windows version is compatible (Windows 10 version 1903 or later, or Windows 11) and that you have administrator privileges on your PC.

What You'll Need

  • A Windows 10 (version 1903 or later) or Windows 11 PC
  • Administrative access to your Windows account
  • Internet connection for downloading updates and Linux distributions
  • Optional: Windows Terminal for an improved command-line experience

Step-by-Step

  1. Check Your Windows Version – Ensure your system meets the minimum requirements. Press Win + R, type winver, and hit Enter. If your version is earlier than 1903, update Windows via Settings > Update & Security > Windows Update.
  2. Enable the Windows Subsystem for Linux – Open PowerShell as Administrator. You can do this by right-clicking the Start button and choosing Windows PowerShell (Admin). In the PowerShell window, enter:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    Press Enter and wait for the command to execute.
  3. Enable the Virtual Machine Platform (for WSL 2) – Still in PowerShell, run:
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    This step is necessary if you want to upgrade to WSL 2, which offers better performance and full Linux kernel support.
  4. Restart Your Computer – After enabling the features, reboot your PC to apply changes.
  5. Download and Install WSL 2 Kernel Update – Visit the official Microsoft page and download the latest WSL 2 Linux kernel update package. Run the installer and follow prompts. This step is crucial for WSL 2 functionality.
  6. Set WSL 2 as Your Default Version – Open PowerShell again and run:
    wsl --set-default-version 2 This ensures new Linux distributions will use WSL 2 by default.
  7. Install a Linux Distribution – Open the Microsoft Store, search for your preferred Linux distribution (e.g., Ubuntu, Debian, Kali Linux), and click Get or Install. Alternatively, in PowerShell, you can run:
    wsl --install -d Ubuntu for an automated installation (Windows 11 supports this command directly).
  8. Launch Your Linux Environment – Once installed, click the Start menu, find your Linux distribution, and click to launch. The first time, it will take a few minutes to set up. You will be prompted to create a username and password for your Linux environment.
  9. Configure Your WSL Environment (Optional) – Customize your Linux setup by installing necessary packages, setting up SSH keys, or configuring your preferred shell (like Zsh or Fish). Use standard Linux commands such as apt update and apt install.

Common Mistakes

  • Not enabling both the WSL and Virtual Machine Platform features before installation.
  • Skipping the WSL 2 kernel update, which can cause errors or limited functionality.
  • Installing an incompatible Windows version or outdated system.
  • Using an older Linux distribution that does not support WSL 2 features properly.
  • Failing to restart the system after enabling features, which prevents proper setup.

Tips

  • Use Windows Terminal for a better command-line interface that supports multiple tabs and profiles.
  • Set up shared drives by accessing /mnt/c for your Windows C: drive within Linux.
  • Update your Linux distribution regularly with sudo apt update && sudo apt upgrade.
  • Use wsl --list --verbose to check the status and version of installed distributions.
  • For advanced users, consider customizing your Linux environment with dotfiles, aliases, and scripts.

Troubleshooting

If WSL does not install or run correctly, try the following steps:

  • Ensure your Windows is fully updated. Check Settings > Update & Security > Windows Update.
  • Verify that the required features are enabled by running dism.exe /online /get-features in PowerShell.
  • Reinstall the Linux distribution from the Microsoft Store or via command line.
  • If you encounter kernel errors, rerun the WSL 2 kernel update installer.
  • Use the command wsl --shutdown to reset all running distributions, then restart WSL with wsl.
  • Check for hardware virtualization support in your BIOS/UEFI settings. Enable Intel VT-x or AMD-V if disabled.

Frequently Asked Questions

Can I run graphical Linux applications with WSL?
Yes, with WSLg (Windows Subsystem for Linux GUI), supported in Windows 11, you can run Linux GUI apps seamlessly.
Is WSL 2 faster than WSL 1?
Generally, yes. WSL 2 offers better performance, full Linux kernel support, and improved compatibility.
Do I need to disable Windows Defender or antivirus software?
Usually not. However, some security tools may interfere; if you encounter issues, temporarily disable them during setup.
Can I upgrade an existing WSL 1 installation to WSL 2?
Yes. Use the command wsl --set-version <distribution> 2 to upgrade individual distributions.
How do I uninstall a Linux distribution?
Open Settings > Apps > Apps & Features, select the distribution, and click Uninstall. Or use PowerShell commands.
Is WSL available on Windows 10 Home?
Yes, WSL is available on Windows 10 Home, but WSL 2 requires Windows 10 version 2004 or later and the Virtual Machine Platform feature.
This comprehensive setup ensures you can fully leverage Linux within Windows, streamlining your development or system administration tasks with minimal fuss. Follow each step carefully, and you'll have a powerful Linux environment at your fingertips, ready to enhance your productivity and workflow.