Install Windows Subsystem for Linux (WSL)
Last Updated :
04 Dec, 2023
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 resource consumption. This makes WSL a go-to choice for people wanting to switch between the two Operating Systems or ones who want to get Linux-like functionality in their Windows OS. WSL2 is a new version of the architecture that allows you to use Linux on top of Windows 10 natively and replaces WSL. In this article, you will learn how to install WSL2 on Windows 10.
Setup of Windows Subsystem for Linux:
Here are some steps to install Windows Subsystem for Linux. We are installing WSL on Windows 10.
Step 1: Open the start menu in Windows by pressing the [Win] key or clicking the bottom right icon of the Windows desktop.
Start menu for Windows Subsystem for LinuxStep 2: Type cmd. A result similar to this would appear.
Opening cmd to install Windows Subsystem for LinuxStep 3: Click on the Run as administrator option on the right side of the taskbar
Run as administrator cmdStep 4: A new window would have appeared similar to this
cmdStep 5: Type the following command and press Enter to install Windows Subsystem for Linux.
wsl --install
`wsl -- install` command to Install Windows Subsystem for LinuxStep 6: The WSL2 installation process has begun. It will install the Linux Kernel during this process. After the process has been completed the user gets acknowledged that Windows Subsystem for Linux (WSL) has been installed.
Windows Subsystem for Linux (WSL) has been installedStep 7: Now WSL has been successfully installed onto the Windows 10 Operating System. Now restart your Operating System. Upon restarting you could use Windows Subsystem for Linux (WSL2).
Note: By default, the Ubuntu distribution gets installed in Windows Subsystem for Linux (WSL2). If you want any specific distribution, you could get so by replacing the command.
wsl --install
wsl --install -d DIST
Where DIST is the name of the distribution you are wanting to install.
Enabling Virtual Machine:
As mentioned earlier, WSL2 is a small virtual machine, so Windows has to accommodate it. If this is already enabled, skip the process and restart your PC to make sure it's ready for installation. The easiest way to do this is with PowerShell. As an administrator, he opens PowerShell and enters the following command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Now you can reboot your PC and be able to do anything on WSL.
Installing Linux Packages:
You can also install Linux packages here. Popular apt and apt-get commands are available. For example, let's install the htop package on this version of Linux and see what happens. First, open the Linux terminal and run the following command to update the APT package repository cache.
Step 1: Type the following command:
$ sudo apt update
update apt in Linux
Step 2: Now install the htop package using the following command.
$ sudo apt install htop
Installing htop in Linux
Step 3: After successfully installing the htop package, we can simply run and execute htop by following command:
using htop command
Conclusion:
In this article we discussed the installation of Windows Subsystem for Linux (WSL) on Windows 10 streamlines which incorporation of a GNU/Linux environment without the need for virtual machines or dual boot configurations. WSL optimizes resource usage, making it ideal for users transitioning between operating systems or seeking Linux-like functionality on their Windows OS. The article guides users through the straightforward installation of WSL2, the latest version, offering native Linux usage on Windows 10. It emphasizes the simplicity of the process, allowing users to choose specific Linux distributions like Ubuntu during setup. Enabling the Virtual Machine platform using PowerShell ensures a smooth experience. The article also explores installing Linux packages through WSL, showcasing its compatibility and functionality. Following these steps empowers users to seamlessly integrate Linux capabilities into their Windows environment, enhancing their development workflow.
Similar Reads
What is Windows Subsystem for Linux (WSL)
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 proble
7 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 Install the Windows Subsystem for Linux on Windows 11?
As a programmer, it is very important to test software on multiple platforms. However, it can be very tedious and inefficient to use multiple virtual machines to achieve the same. Thankfully, this process can be simplified if you are using Windows and wish to run a Linux distribution - with WSL. WSL
2 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 install Ruby on Windows?
Prerequisite: Ruby Programming Language Before we start with the installation of Ruby on Windows, we must have first-hand knowledge of what Ruby is?. Ruby is a pure Object-Oriented language developed by Yukihiro Matsumoto (also known as Matz in the Ruby community) in the mid-1990s in Japan. Everythi
2 min read
How to Install LISP on Windows?
Lisp is a high-level machine-independent programming language that is used in making AI-based programs as it supports the implementation of such software that deals with computation with symbols efficiently. It is the second-oldest high-level programming language. In this article, we will learn abou
1 min read
How to Install WebStorm on Windows?
WebStorm is a cross-platform integrated development environment (IDE) and is used for developing web applications in React, Vue, Angular, Express, Php, Meteor, Ruby, etc. It has been maintained by Jetbrains since its launch and is primarily written in Java. As one of the most popular JavaScript IDEs
2 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
How to Install Wireshark on Windows?
Wireshark is software that is widely used in the analysis of data packets in a network. Wireshark is completely free and open source. This packet analyzer is used for a variety of purposes like troubleshooting networks, understanding communication between two systems, developing new protocols, etc.
3 min read
How to Install Seaborn on Windows?
In this article, we will look into the process of installing Python Seaborn on Windows. Prerequisites:PythonPIP or conda (Depending upon user preference)For PIP Users: PIP users can open up the command prompt and run the below command to install Python Seaborn Package on Windows: pip install Seaborn
1 min read