The Wayback Machine - https://web.archive.org/web/20240901135905/https://www.geeksforgeeks.org/what-is-windows-subsystem-for-linux-wsl/
Open In App

What is Windows Subsystem for Linux (WSL)

Last Updated : 14 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In today’s computing landscape, we often require different operating systems for our tasks to execute. The demand for Linux-based Operating systems is always high among Windows users. Now to use Linux we either need Virtual Machines or Dual Boot System. Windows Subsystem for Linux solves this problem gives users the privilege to use Linux on Windows easily. In this article, we will learn about WSL and how we can use it.

What is Windows Subsystem for Linux (WSL) ?

Windows Subsystem for Linux (WSL) is a compatibility layer developed by Microsoft for Windows Computers to run Linux applications, utilities, and commands in the computer using a Command prompt or terminal. This eliminates the need for a Dual boot computer or Virtual Machine setup and saves computing resources. To use WSL we must use Windows 10 and higher versions. The supported Linux distributions are Ubuntu, Arch, Fedora, Kali, and others.

Features of Windows Subsystem for Linux (WSL)

1. Linux binary execution:

WSL allows users to run native Linux binaries on a Windows machine directly. There is no need for Virtual machines or emulators. This enables access to the large ecosystem of Linux applications, tools, and utilities while using a Windows Operating system.

2. Linux Bash Shell:

WSL provides a Bash Shell in the Windows Terminal layout and Linux command line tools. Users can use the same Linux commands to interact with the Linux environment using the terminal. The utilities provided includes, file manager, text processor, package manager, and more.

3. Linux File System:

Windows Subsystem for Linux creates a file system with it’s directory in the Secondary Memory (Hard Drive) and can be managed using the command line utility. The Linux file system can be managed by both Windows and Linux. Users can perform Create, Read, Update, Delete operations on the file system.

4. Support for Multiple Linux Distributions:

WSL supports multiple Linux Distributions to use in windows machine. The supported distributions are Ubuntu, Arch, OpenSUSE, Debian, Kali, and more. Users can choose the preferred distribution form Microsoft store and install in the windows environment to create a Linux system within.

Steps to Install and Setup Windows Subsystem for Linux

Step 1: Check System Requirements

Before we move ahead with installing WSL, we need to make sure that our computer supports WSL. The recommended configuration is,

  • x64 bit processor
  • Windows 10 version 2004 (Build 19041 and higher) or Windows 11

To check it, click on Start and search for “System information” and check for OS name, Version and System Type.

check System Requirements

check System Requirements

Step 2: Enable WSL

Once the requirements are matched, search for Windows Features and a box will open, find out Windows Subsystem for Linux and tick it to enable.

Enable WSL

Enable WSL

Click on OK and Restart the computer.

Step 3: Install WSL

Open PowerShell or Windows Command Prompt in administrative mode by clicking Run as administrator and execute the following command.

wsl --install

Output:

Install WSL

Install WSL

As you can see it has started installing the necessary features and enabling them for use. Furthermore, you can see that It’s installing Ubuntu as the default Linux distro for WSL.

Step 4: Choose Linux Distribution

Once WSL is installed, it’s the time to choose the suitable Linux distro for you to use. Open Microsoft Store and search for Linux. You will get all the available Linux operating systems. Choose the one that suits your requirement and click on Install.

Choose Linux Distribution

Choose Linux Distribution

Step 5: Set up WSL

Once installed, you will get the icon for the Linux as an application. Click on the application icon and your Linux Machine will start in form of a Terminal.

Set UP WSL

Set UP WSL

Set up the Username and Password for the instance and you are good to go. Now you can execute all your Linux commands here in the terminal itself.

Use Cases and Applications

1. Software Development

WSL provides a platform to the developers to develop, test and debug software. Using a Linux environment along side windows at the same instance, developers can easily build, compile, and test Linux-based applications without using a separate machine or Virtual Machine. This helps significantly in software development and increases productivity.

2. Web Development

Web Developers, particularly the backend developers who works for the server side most of the time uses Linux in the web servers. Using WSL, developers can set up a local Linux server for development and use it to run their changes before sending to production.

3. Educational Purpose

In engineering and similar field we have the Operating system Lab where we need a Linux or Unix environment to execute tasks and learn about the subject. WSL is an ideal platform for students to learn and execute Linux commands without the need of powerful hardware or any heavy virtualization software. They can get a hands-on experience on topics like file system, command line utilities, and more.

4. Ethical Hacking

Ethical hacking enthusiasts and beginners can use Kali Linux as WSL and execute Linux scripts. They can use WSL as a platform to perform penetration testing, vulnerability assessment, security analysis by using Linux tools on WSL. Users can assess the security posture of system, network and application using this.

Tips and Tricks for WSL

1. Customize WSL

You can customize the WSL and modify the Linux Distribution by accessing the configuration files to better your user experience. You can customize shell profiles, aliases and keyboard shortcuts to better use of the WSL.

2. Use Windows Terminal

Install the Windows Terminal application from Microsoft store to use Command line interface for WSL. Windows Terminal will provide a modern tabbed interface with the access to multiple shells like PowerShell, command prompt and others to be use simultaneously. This makes it easier to switch between tabs and manage different environments.

3. Use Windows using Linux commands

Using WSL you can use Linux commands on Windows File system to access and modify. You can use Windows directory as if they are part of the Linux system. You can also launch Windows applications, create files, manipulate files on Windows using Linux commands and tools in WSL.

Conclusion

Windows subsystem for Linux is a significantly important application which integrates Windows and Linux environments and offers seamless usability of both the environments. Use the step by step installation process in the article to install WSL in your computer. Follow the tips and tricks for better usability.

Windows Subsystem for Linux – FAQs

Can I run Ubuntu using WSL ?

Yes, you can run the famous Linux distributions including Ubuntu on Windows computer using WSL.

Is WSL and Virtual Box are same ?

No, WSL provides a layer over Windows OS to run Linux binaries whereas, VirtualBox uses virtualization to create separate Linux kernel for Linux OS.

How to update WSL ?

You can update WSL using the package manager of the Linux distribution you are using. For Ubuntu use “sudo apt update” and “sudo apt upgrade”.

Is WSL a free software ?

Yes, WSL is free to use and now comes pre-installed with latest Windows computers. However your computer must satisfy the requirements to run WSL on your computer.



Similar Reads

How to set up OpenSSH server in Windows Subsystem for Linux (WSL)?
In this article, we will elaborate on how you can set up an OpenSSH server in WSL. Also, how can we locally connect to Ubuntu via cmd from the Windows OS we are running locally in our system? Use the Windows Powershell here, it would be easy to do the steps. Users need to have Windows Subsystem for Linux (WSL) installed and setup in their device. T
8 min read
How to use Kali Linux in Windows with WSL 2?
The Windows Subsystem for Linux lets developers run a GNU/Linux environment including most command-line tools, etc. direct on Windows, unmodified, without the overhead of an ordinary virtual machine or dual-boot system. Uses of WSL: Pick your preferred GNU/Linux distributions from the Microsoft Store.Run basic command-line tools, for example, grep,
5 min read
How to Install Linux on Windows PowerShell Subsystem?
There are several ways to Install a Linux subsystem on your Windows PC Powershell Environment. It is good for learners, but it is recommended using original Linux OS if you are a developer as the Subsystem lacks the pre-installed Linux tools. Before we begin installing a Linux subsystem, we need to first enable a Windows feature for Subsystems. Ena
2 min read
How to disable superfetch in windows 10 or windows 11?
Windows Vista introduced the Superfetch (SysMain) capability, which is still a part of the Windows operating system. It is a built-in service designed to speed up startup times and enhance performance by preloading frequently used apps in RAM. It was, however, primarily developed for older PCs. For contemporary PCs running Windows 10 and Windows 11
4 min read
How to run Linux Commands on Windows 10?
It is a dilemma when you want to switch from one operating system to another. This is a common case when you switch from Windows to Linux. Either you store your data and then uninstall Windows to install Linux and then transfer your data or you can have a dual boot system where you encounter an option as to which OS to choose in the beginning. Don'
2 min read
Linux vs Windows Commands
Most of us think that Linux has terminal and we can use a command-line interface only in Linux but it is just a myth. There is a PowerShell and a command prompt in windows as well where we may execute the commands easily. But Windows and Linux have commands with the same name as well. .linux-vs-windows-table { border-collapse: collapse; width: 100%
2 min read
Dual Boot Kali Linux with Windows
Sometimes we came across situations like when we want to start learning Linux and command line stuff but using Linux as a main Operating System without having a basic idea of it is not a good option. So in order to do that we may install the same alongside windows. And choose which Operating System we want to work on at which time. Before proceedin
4 min read
eDEX-UI Terminal for Windows, Mac and Linux
eDEX-UI is a fullscreen window, cross-platform terminal emulator, and system monitor which looks and feels like a sci-fi computer interface. Features of eDEX-UIIt has fully featured terminal emulator Tabs, colors, mouse events, and other features.It supports curses and curses-like applications.It also monitors real-time-time systems (CPU, RAM, swap
3 min read
How to Connect to Amazon Linux Instance from Windows Client Operating System using PUTTY?
In this article, we will learn how to connect the Amazon Linux instances from Windows client operating system. For this we will be performing the following operations: Create a Linux instance in Amazon AWS.Using putty application connect to the Linux instance from the windows client operating system.Create a Linux instance in Amazon AWS: Follow the
2 min read
How to Use Linux Commands in Windows with Cygwin
Cygwin is a collection of tools that provide a Linux Operating System's terminal look, feel, and some of its basic functionality for users of Windows OS who want to have a go over the basic commands of Linux without worrying about installing a Linux OS. To use this tool, first of all, we need to download Cygwin setup depending on the version of Win
3 min read
How to run Linux GUI apps on Windows with WSLg?
In this article, we will see how you can install your favorite Linux GUI application on your Windows PC/Laptop. For this, we will use WSLg. WSLg which stands for Windows Subsystem for Linux GUI is an open-source project that enables the support for running Linux GUI applications on Windows in a fully integrated desktop experience. WSLg offers a sea
2 min read
How to Switch from Windows to Linux without Losing Data?
Linux is the most widely used in the world due to being open source and secure due to having a large community. There are almost 3 billion people around the world who use Linux operating system one way or another. Linux is widely used by most programmers because of its installed applications out of the box. Many people think of using Linux but they
5 min read
How to Dual Boot Windows 10 and Linux Mint?
Dual booting is the process of installing two operating systems on a single machine. In reality, such a system allows for the installation of various operating systems. However, how does the computer know which operating system to boot? The boot area can be occupied by a boot loader that comprehends various file systems and numerous operating syste
4 min read
How to build a Linux server on a Raspberry Pi from Windows?
The Raspberry Pi is a small, inexpensive computer that is of the size of a credit card that connects to a computer monitor or TV and operates with a regular keyboard and mouse. With the help of this competent small gadget, individuals of all ages may learn about computing and how to program in languages like Scratch and Python.It can be used to set
6 min read
How to Run Linux Software on Windows
Although Windows users could also wish to run Linux software, Linux users frequently desire to run Windows applications on Linux. You can use Linux applications without leaving Windows, whether you're searching for an improved development environment or strong command-line tools. There are several alternatives to purchasing a new laptop to run the
5 min read
Transfer files and folders from Windows to Linux with WinSCP
IntroductionWhen using Linux machines, either as a Virtual Private Server or as a Virtual Machine on your local computer, one of the major problems that people encounter is to transfer their files from their host (main) machine to the Linux machine. This problem is generally resolved by a file transfer protocol client such as WinSCP and FileZilla.
5 min read
How to ping an Ip on windows macos and Linux
Ping is a command line networking utility that uses ICMP packets to check if a logical route is available to communicate with a specific host. A failure of the ping command doesn't necessarily mean that the host is down. There are many other possible reasons for the failure. Along with the primary purpose of ping, this command can also provide insi
8 min read
Creating and Running a Fedora Linux Live USB stick on a PC with Windows 11
This article presents a brief overview of the Fedora operating system, describes what live boot is, and then shows how to create a live bootable USB drive and then run a live version of the operating system on a PC with Windows 11 (Home). Overview of FedoraFedora Linux is a popular free and open-source operating system (Linux distribution) develope
6 min read
How to Run Multiple Virtual Machines Windows and Linux Inside VirtualBox?
Virtual Machines are the software applications/files which emulate the physical computers. This process of emulating a physical computer and making able to run instances of it on a single physical machine is called Virtualization. A Virtual Machine (VM) allows us to run multiple or different Operating systems on a single physical machine and share
11 min read
Uninstall Linux completely from a PC with Windows
We would learn here how to completely uninstall any Linux OS from PC through Windows. This is a procedure that involves to steps-> (i) Delete Linux Partition (ii) Remove Linux OS from EFI System Partition You must be thinking what is EFI System Partition? The EFI system partition (ESP) is a partition on a storage device that is used by computers
2 min read
How To Share File From Host Machine(Windows) To Guest Machine(Linux)
We need to have Ubuntu installed in our Virtual Box for the purpose of this experiment. The host machine is Windows 10 in the following experiment. Transfer File From Host Machine(Windows) To Guest Machine(Linux) 1. Method 1: Installing SSH on Ubuntu Terminal and allowing Firewall blockage Open Terminal in Ubuntu which is installed in Virtual Box a
4 min read
Download & Install Terraform on Windows, Linux
A vital part of efficiently handling and provisioning cloud resources is infrastructure as code, or IaC. HashiCorp's open-source Terraform tool has become a top option for infrastructure-as-a-service (IaC) due to its ease of use, adaptability, and wide range of support for cloud providers and services. Terraform is crucial for learning, regardless
8 min read
Difference Between Arch Linux and Kali Linux
Arch Linux is an open-source Linux-based Operating System that is freely available for use. It belongs to the Pacman-based Linux family. It is a light weighted OS for daily use and could even be used by professionals. It was first released in March 2002. It is a beginner-friendly Linux Operating System. Features of Arch Linux: Minimalist approach:
4 min read
Neofetch In Linux – Snap cool screenshots of your Linux
Neofetch is a fancy, highly customizable, and aesthetic command-line system information screenshot utility tool. Written in the Bash scripting language, it works inside a terminal window, on triggering up the command it by default displays the operating system, software, and hardware of your system on the right side of the column alongside an ASCII
4 min read
Exodus - Copy Linux Binaries From One Linux System
Exodus is an easy-to-implement program, that is used for bundling dependencies, and also helps to effectively copy Linux ELF binaries from one to another machine securely, and this is very handy when you don't have root access, also if there are issues in the availability of the packages in the Linux distribution, Commonly Server oriented distribut
3 min read
Basic CentOS Linux Commands in linux
CentOS is a free and open-source operating system that aims to provide a stable reliable, and community-supported platform for servers and other enterprise applications. In this article, we will be covering CentOS Linux basics commands and functions of CentOS and also we will look into the advanced commands. These CentOS commands allow you to manag
3 min read
Linux on Azure – Linux Distributions
Azure, the cloud computing platform from Microsoft, offers a playground for deploying and managing your Linux-based operating systems. Think of it as a canvas of boundless resources, security, and scalability, painted onto which you can unleash the boundless creativity and flexibility of Linux. This powerful synergy unlocks a world of opportunity,
10 min read
Complete Guide to Install C++17 on Windows
In the Competitive Programming field C++ is one of the most used language, because of it's huge STL(standard template library) functions, and day by day its getting updated. So here is the complete guide to install the latest version of C++(C++ 17) and also setup guide for Sublime Text and CodeBlocks. Install C++17 Compiler(GCC 9.2) To install C++1
3 min read
Leap Year Program with Bash Shell Scripting in Windows
Accurately the Earth has 365.24 days per year, to correct the approximation and keep track of the Solar Calendar the idea of leap year has been introduced to Gregorian Calendar. A leap year comes once every four years. In contrast, it has 366 days with regular years, having 365 days. Mathematical approach to check:Every year is a Leap year if it is
1 min read
Calculator Program with Batch Scripting in Windows
By using the Batch Scripting of command prompt one could even design a normal basic calculator that takes expressions and returns the result. Type the following script in notepad or any other text editor software: @echo off :a echo ________Calculator________ echo. set /p expression= Enter expression to calculate: set /a ans=%expression% echo. echo
2 min read
Article Tags :