Smart Systems for Home

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

Install Ubuntu on Windows via WSL: Easy Guide

· 5 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

Yes, you can run Ubuntu directly inside Windows without dual-booting or using a virtual machine. The Windows Subsystem for Linux (WSL) gives you a real, integrated Linux terminal that shares files with Windows. This guide shows the easiest method: installing Ubuntu via the Microsoft Store. You'll need Windows 10 version 2004 or higher, or Windows 11. No prior Linux experience is required.

What You'll Need

  • A PC running Windows 10 (version 2004 or newer) or Windows 11.
  • Administrator access to your Windows account (to enable WSL).
  • An internet connection to download Ubuntu and the WSL components.

Step-by-Step

  1. Open PowerShell as Administrator. Click the Start button, type PowerShell, right-click Windows PowerShell, and select Run as administrator. Accept the UAC prompt if it appears.
  2. Enable the WSL feature. In the PowerShell window, type the following command and press Enter:
    wsl --install
    This installs WSL 2 (the latest version) and the Virtual Machine Platform. It may require a restart. If you get an error about needing the “Microsoft-Windows-Subsystem-Linux” optional component, continue with the manual steps in the Troubleshooting section.
  3. Restart your PC. When prompted, restart to finish enabling WSL.
  4. Install Ubuntu from the Microsoft Store. After restarting, open the Microsoft Store app, search for Ubuntu, and choose the latest LTS version (e.g., Ubuntu 24.04 LTS). Click Install. This downloads and installs the Ubuntu app.
  5. Launch Ubuntu. Click Launch from the Store, or find “Ubuntu” in your Start menu and open it. The first launch opens a console window and asks you to create a UNIX username and password. This is separate from your Windows credentials.
  6. Update Ubuntu packages. Once the terminal opens, run these commands to update the package list and upgrade installed packages:
    sudo apt update
    sudo apt upgrade
    Enter your Ubuntu password when prompted. This ensures you have the latest security patches.
  7. Use Ubuntu. You now have a full Ubuntu environment. You can install additional software with sudo apt install [package-name], access Windows files from /mnt/c/, and run Linux commands directly.

Common Mistakes

  • Not running PowerShell as administrator. The wsl --install command fails without admin rights. Always right-click and choose “Run as administrator”.
  • Installing Ubuntu before enabling WSL. If you install the Ubuntu app from the Store before WSL is enabled, it may not start correctly. Enable WSL first, then install Ubuntu.
  • Using an outdated Windows version. WSL 2 requires Windows 10 version 2004 or higher. If you're on an older version, update Windows first.
  • Forgetting your Ubuntu password. The password you set on first launch is for Linux, not Windows. If you forget it, you'll need to reset it via PowerShell (see Troubleshooting).

Tips

  • Use WSL 2. WSL 2 offers better performance and full system call compatibility compared to WSL 1. The wsl --install command defaults to WSL 2. To check your version, run wsl --status.
  • Access Windows files easily. Your Windows drives are mounted under /mnt/c, /mnt/d, etc. For example, to access your Documents folder, type cd /mnt/c/Users/YourName/Documents.
  • Run Ubuntu from Windows Terminal. If you install Windows Terminal from the Store, you can open Ubuntu in a tab, making it easier to manage multiple terminals.
  • Set up SSH keys. To avoid typing passwords for Git or remote servers, generate an SSH key inside Ubuntu with ssh-keygen and add the public key to your services.
  • Keep Ubuntu updated. Run sudo apt update && sudo apt upgrade regularly to stay secure.

Troubleshooting

“wsl --install” fails with an error. If you see an error about the optional component, try enabling WSL manually:

  1. Open PowerShell as Administrator.
  2. Run dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart.
  3. Run dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart.
  4. Restart your PC.
  5. Then run wsl --set-default-version 2 to ensure WSL 2 is used.

Ubuntu launches but shows “WSL 2 requires an update.” Run wsl --update from PowerShell to install the latest WSL kernel.

Ubuntu doesn't start after installation. Ensure your Windows is fully updated. Then open PowerShell as Administrator and run wsl --set-default-version 2. If that fails, try wsl --set-default-version 1 (though WSL 1 is slower).

Forgot your Ubuntu password. Open PowerShell as Administrator and run wsl -u root to enter Ubuntu as root. Then run passwd your-username to set a new password. Exit with exit.

Ubuntu is slow. Make sure you're using WSL 2 (check with wsl --status). Also, close unnecessary Windows apps to free memory. If you have an HDD, consider moving the WSL virtual disk to an SSD.

Cannot access the internet inside Ubuntu. Try sudo apt update again. If that fails, check your Windows network connection. In rare cases, restarting the WSL service helps: run wsl --shutdown in PowerShell, then relaunch Ubuntu.

Frequently Asked Questions

Is WSL free?

Yes, WSL is a free feature built into Windows, and Ubuntu is free to download from the Microsoft Store.

Can I run graphical Linux apps?

Yes, WSL 2 supports GUI apps (like Firefox or GIMP) if you have Windows 10 version 19044+ or Windows 11. Just install the app in Ubuntu and launch it from the terminal.

Will WSL affect my Windows performance?

WSL 2 uses a lightweight virtual machine, but it only consumes resources when you run Linux processes. It won't slow down Windows when idle.

Can I access my Windows files from Ubuntu?

Yes, Windows drives are mounted under /mnt/c, /mnt/d, etc. You can read and write to these files.

How do I uninstall Ubuntu?

Open Settings > Apps > Installed apps, find Ubuntu, and click Uninstall. You can also remove WSL entirely with wsl --uninstall in PowerShell (this removes all distributions).

Can I install other Linux distributions?

Yes, you can install Debian, Kali, openSUSE, and others from the Microsoft Store. The process is the same as for Ubuntu.