Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Linux»How to Install Linux Terminal on Windows

How to Install Linux Terminal on Windows

Anup ThapaBy Anup ThapaSeptember 19, 2022
linux terminal for windows

When you need to run Linux command-line tools or even GUI applications on a Windows machine, the first thing to come to mind is often virtual machines. And while that does work, there is a better option. The Windows Subsystem for Linux (WSL) feature creates a compatibility layer that allows you to run Linux binary executables natively on Windows. 

This is more efficient as WSL doesn’t have to deal with the overhead of a usual VM setup, meaning it requires fewer resources. WSL also allows you to use both Windows and Linux tools on the same files, as you’re able to directly access the Windows files from Linux.

And while there are numerous such reasons to use WSL, the one that’s most relevant to us is that WSL lets you use a Linux terminal on Windows. As such, we’ll focus on WSL and the steps to install a Linux terminal using it in this article.

Table of Contents

  • WSL 1 and WSL 2
  • Install Linux Terminal For Windows
  • Install or Upgrade to WSL 2
  • Troubleshooting Common Issues

WSL 1 and WSL 2

Microsoft first introduced WSL in 2016 with the Windows 10 version 1607 Anniversary Update. WSL 1 used the LXSS Manager Service (particularly the lxss.sys and lxcore.sys drivers) for interactions between Windows and the subsystem.

WSL 1 didn’t utilize virtualization and instead made direct use of some of the hardware and the host file system, which had some implications. For instance, the virtual network adapter would be bridged to the host NIC, meaning the Linux distribution would have an IP address in the same network as the host machine.

WSL 2 was released with the version 2004 update in 2020. It made considerable changes to the architecture to increase file system performance and support full system call compatibility.

WSL 2 utilizes a specific optimized set of Hyper-V features to run the Linux kernel inside a lightweight VM. The hardware components are virtualized as well, but because this VM runs behind the scenes, the user experience is no more complicated than before.

The WSL 2 VM uses a full Linux kernel that’s optimized for best performance and auto-serviced via Windows Updates. And while WSL 1 stored the Linux files on the Windows drive, WSL 2 uses a virtual hard disk formatted with ext4. This essentially means that WSL 2 offers way better performance, compatibility, and support for GUI applications.

WSL 2 is only supported on Windows 11 or Windows 10 version 1903 or later. Aside from some very niche scenarios, you should always opt for WSL 2, provided it’s supported on your Windows build.

With all that said, we’ll first talk about installing WSL 1. But if you just need steps to upgrade to or install WSL 2, you can skip ahead to the next section.

Install Linux Terminal For Windows

Here’s how you can install a Linux terminal with WSL 1:

  1. Press Win + R, type powershell, and press CTRL + Shift + Enter.
  2. Execute the following command:
    dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all
    dism-enable-microsoft-windows-subsystem-linux
  3. Press Y to accept the prompt to restart your PC.
  4. After booting, download your preferred distro from the WSL Store. If that doesn’t work, you can download and install it directly from Microsoft’s site.
    get-debian-ms-store
  5. After the download completes, press Open.
  6. After the installation completes, enter a new UNIX username and password.
    wsl-debian-username-password
  7. The setup process is pretty much done. As for what to do next, we recommend starting by updating and upgrading the packages. For instance, on Ubuntu, you can do this with sudo apt update && sudo apt upgrade. After that, you can start playing around in the terminal and running shell scripts or whatever else you prefer.

You can manage WSL’s Linux distros via Powershell or CMD with the wsl command (eg. wsl ls -la), or you can enter bash to open a Bash shell. Microsoft recommends using Windows Terminal, as it allows you to open and switch between multiple distros and command lines easily.

ls-la-wsl-debian

Install or Upgrade to WSL 2

As WSL 2 utilizes virtualization, you must first enable hardware-assisted virtualization via the BIOS. You’ll find the virtualization option (AMD-V, SVM, VT-d, VT-x, or something similar) in the Advanced or CPU Configuration section.

Afterward, all you need to do is run the wsl --install command. This command will automate everything, from enabling the required features to installing WSL and the default Linux distro (Ubuntu).

The last part won’t be satisfactory to a lot of users. As such, we’ll now talk about how to perform other tasks like installing specific Linux distributions.

  • To list the Linux distros available through the WSL Store:
    wsl -l -o
    wsl-l-o
  • To install WSL with a specific distro:
    wsl --install --distribution <Distribution Name>
  • After the initial install, you can install additional distros with:
    wsl -d <Distribution Name>
  • To set the WSL version for a Linux distro to 1 or 2:
    wsl --set-version <distribution name> <versionNumber>
    wsl-set-version-distribution-version
  • To manually update the WSL Linux kernel:
    wsl --update
  • To rollback the kernel version:
    wsl --update rollback
  • To terminate the WSL 2 VM and all running distros:
    wsl --shutdown

Troubleshooting Common Issues

When installing WSL, users often encounter some errors. You can check the troubleshooting guide from Microsoft for a detailed list, but we’ll address the common ones right here:

  • Installation failed with error 0x80070003
    Go to Settings > System > Storage > More / Advanced Storage Settings > Change where new content is saved and ensure new apps save to the system drive (usually C:).
    where-new-content-is-saved
  • Error 0x80070003 or error 0x80370102
    Ensure virtualization is enabled in the BIOS.
  • WslRegisterDistribution failed with error 0x8007019e
    Ensure the WSL feature is enabled. If it’s disabled, you can enable it by running the following command in an elevated PowerShell window:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Error: Windows Subsystem for Linux has no installed distributions.
    WSL distributions are user-account specific. So, ensure you installed the distros on the same account you’re using right now.
  • Error: WSL 2 requires an update to its kernel component.
    If you manually installed WSL 2 instead of using the command we showed above, you must also install the kernel update package. Additionally, you should also ensure the Virtual Machine Platform feature is enabled by running the following command in PowerShell:
    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
how-to
Anup Thapa
  • LinkedIn

Anup Thapa is a tech writer at TechNewsToday. He mostly writes informative articles, tutorials, and troubleshooting guides related to Windows systems, networking, and computer hardware. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields like coding, hardware installation, writing, etc. In doing so, he's worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skillset, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader's problems efficiently. You can contact him at anup@technewstoday.com

Related Posts

how to change boot order on linux

How to Change Boot Order on Linux

December 16, 2022
make-command-not-found

How to Fix “Make: Command Not Found” Error

September 20, 2022
How-to-force-Quit-an-app-on-Linux

How to Force Quit an App on Linux

August 30, 2022
best linux for virtualbox

8 Best Linux Distros to Try in VirtualBox

August 30, 2022
ifconfig command not found

How To Fix “ifconfig Command Not Found” Error?

December 18, 2022
format usb linux

How To Format USB In Linux (5 Easy Ways)

August 22, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
what-does-collate-mean-on-a-printer

What Does Collate Mean on a Printer?

March 31, 2023
usb-vs-pcie-wifi

USB Vs PCIe Wi-Fi—Which One is Better?

March 31, 2023
how often to replace laptop

How Often Should You Replace a Laptop

March 29, 2023
You may also like
computer suddenly slow

Why is My Computer Suddenly Slow? 11 Ways to Fix It

March 31, 2023
HTTP-Error-431

How to Fix HTTP Error 431

March 31, 2023
scheduled task reboot

How to Create a Reboot Scheduled Task in Windows

March 31, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.