What is Windows Subsystem for Linux (WSL)
Last Updated :
14 May, 2024
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.
Windows Subsystem for Linux (WSL)
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 RequirementsStep 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 WSLClick 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 WSLAs 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 DistributionStep 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 WSLSet 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.
Similar Reads
Install Windows Subsystem for Linux (WSL)
The Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment on Windows, without the overhead of a traditional virtual machine or dual boot setup. This incorporates Linux-like functionality on Windows OS without the overhead of running another OS in parallel, therefore, reducing
4 min read
How to Install Git on Windows Subsystem for Linux?
Git is an open-source distributed version control system developed to handle everything from simple to complex projects with performance and speed. Git software allows a team or group of developers to work together, with all using the same files and folders. It gradually reduces the confusion that t
2 min read
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
8 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
2 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 Stor
5 min read
What is the Windows Key (winkey)?
Windows key is a key found on keyboards, It's typically located between the Ctrl and Alt keys on the bottom row of the keyboard, either on the left or right side. The Windows key is used to access various system functions and shortcuts in Windows, such as opening the Start menu, launching programs,
7 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 a
5 min read
What is Linux System Administration?
Linux System Administration involves managing the operations of a Linux-based computer system. System administrators (or sysadmins) are the gatekeepers of the IT infrastructure, ensuring that all related hardware and software work reliably and securely. In this article, you will go through the basic
6 min read
What is Linux Operating System
The Linux Operating System is a type of operating system that is similar to Unix, and it is built upon the Linux Kernel. The Linux Kernel is like the brain of the operating system because it manages how the computer interacts with its hardware and resources. It makes sure everything works smoothly a
13 min read
How to Install Rust on Windows and Linux Operating System?
Rust is a blazing fast and memory-efficient static compiled language with a rich type system and ownership model. It can be used to power performance-critical services while guaranteeing memory-safety and thread-safety, empowering developers to debug at compile-time. In addition to that Rust has gre
2 min read