Linux Tactic

Boost Your Development Workflow: Enabling WSL on Windows

Enabling WSL on Windows:

A Complete Guide

Do you have a need to use command-line interfaces for various tasks? Have you ever wanted to use a Unix-based terminal without having to switch your primary operating system to Linux or Unix?

If you answered yes to either of these questions, then Windows Subsystem for Linux (WSL) might be the solution for you.

In this article, we will walk you through the step-by-step process of enabling WSL on your Windows machine, installing Linux Ubuntu using the Microsoft Store, and verifying your WSL configuration.

Let’s dive in!

Enabling Developer Mode:

Before we enable WSL on Windows, we first need to make sure that Developer Mode is turned on. To do this, we need to navigate to the Windows Settings menu.

Once there, we can change the Developer Mode setting. Here are the steps:

1.

Open Windows Settings menu. (Use the Windows key on your keyboard or click on the Windows icon on the bottom left of the screen.)

2.

In the Windows Settings menu, select Update & Security. 3.

Click on the For developers tab. 4.

Select the Developer mode option. Enabling WSL using GUI:

Now that we have Developer Mode enabled, we can enable WSL on our Windows machine.

There are several ways to enable WSL, but the easiest way is through the optionalfeatures.exe GUI. Here are the steps:

1.

Open the Run dialogue box. (Use the Windows key + R on your keyboard to do this.)

2.

Type in optionalfeatures.exe and click OK. 3.

Scroll down the list of features until you find Windows Subsystem for Linux. 4.

Check the box next to it and click OK. 5.

Restart your computer to complete the installation. Enabling WSL using PowerShell:

If you prefer using PowerShell over the GUI, you can enable WSL from the command prompt.

Here is how you can do it:

1. Open PowerShell as an administrator.

(Right-click on the Start button and select Windows PowerShell (Admin).)

2. Type in the following command: enable-feature -name Microsoft-Windows-Subsystem-Linux -all

3.

Press Enter. 4.

Restart your computer to complete the installation. Installing Ubuntu using Microsoft Store:

Now that WSL is enabled on your Windows machine, you can install any Linux distribution from the Microsoft Store.

Let’s install Ubuntu for WSL. Here are the steps:

1.

Click on the Start button and type in Microsoft Store. 2.

In the Microsoft Store, search for Ubuntu. 3.

Click on the Ubuntu app and select Get. 4.

Wait for the installation to complete. Verifying WSL Configuration:

Once you have Ubuntu installed, you can verify that WSL is working.

There are several ways to do this, but we will use the WSL command in PowerShell. Here are the steps:

1.

Open PowerShell. 2.

Type in wsl and press Enter. 3.

You should now see the Ubuntu terminal open.

4.

Type in ls to see the list of files in your Ubuntu home directory. 5.

Type in exit to close the Ubuntu terminal. Conclusion:

WSL is a great tool for developers who want to use Linux or Unix-based terminals on their Windows machines.

With a little bit of setup, you can have a fully functional Ubuntu terminal at your disposal. We hope this guide has been helpful in enabling WSL on your Windows machine, installing Ubuntu from the Microsoft Store, and verifying your WSL configuration.

Happy coding!

Benefits of WSL on Windows:

WSL is a tool that allows users to run Linux-based distributions on a Windows machine. It enables developers to have access to the Linux terminal and its powerful command-line interface (CLI) tools, without having to switch their operating system to Linux.

There are many benefits to using WSL on Windows:

1. Familiarity – For developers who are used to working with Linux, WSL provides a familiar environment with a Linux terminal and familiar CLI tools.

2. Easy Installation of Linux Distros – Installing Linux distributions on WSL is much easier compared to dual-booting or installing a virtual machine.

Users can simply install any preferred Linux distro from the Microsoft Store. 3.

Efficiency – WSL is a lightweight solution that runs directly on the Windows kernel, which means it uses fewer resources than virtual machines or dual-booting. 4.

Integration – WSL integrates fully with the Windows environment. This integration features the ability to run Windows executables from the Linux environment and vice versa.

Methods to enable WSL:

There are two commonly used methods to enable WSL on Windows- using the graphical user interface (GUI) or PowerShell. Enabling WSL using GUI:

The most straightforward method of enabling WSL is through the use of the Windows Features GUI.

Here are the steps:

1. Open the Windows Start menu.

2. Type “Windows Features” in the search bar and select “Turn Windows features on or off.”

3.

Scroll down through the list of features until you find “Windows Subsystem for Linux”. 4.

Tick the box next to it and click on “Ok”. 5.

Restart the computer to complete the installation of WSL. Enabling WSL using PowerShell:

Alternatively, you can use PowerShell to enable WSL on your Windows machine.

Here are the steps:

1. Press the Windows key + X to open the Quick Link Menu.

2. Select Windows PowerShell (Administrator).

3. Type in the following command and then press Enter:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

4. When prompted, restart your computer to finish installing WSL.

Installation of Ubuntu on WSL:

Now that WSL is enabled on our Windows machine, we can proceed to install Ubuntu from the Microsoft Store. Here are the steps:

1.

Open the Microsoft Store. 2.

In the Microsoft Store, search for Ubuntu. 3.

Click on the Ubuntu app and select Get. 4.

Wait for the installation to complete. Once the installation is complete, Ubuntu will be listed in the Start menu.

Clicking on the Ubuntu icon will open Ubuntu in its own terminal window, run by WSL. From here users can run Linux applications and execute Linux commands.

In conclusion, WSL is a powerful tool that brings Linux-based distributions to Windows machines, offering users a familiar and efficient environment to work with. By following the simple steps above, it is possible to enable WSL and install Ubuntu Linux on your Windows machine quickly.

Whether you’re a software developer or a Linux enthusiast, WSL is an ideal solution that can significantly improve your workflow. In summary, Windows Subsystem for Linux (WSL) is a lightweight solution that enables users to run Linux-based distributions on Windows machines.

With WSL, developers can use familiar Linux tools and commands without having to switch their operating system. This article has explained the various benefits of using WSL on Windows, including easy installation of Linux distros, increased efficiency, and complete integration with the Windows environment.

The article also highlighted two methods of enabling WSL – using the GUI or PowerShell – and how to install Ubuntu on WSL. Ultimately, WSL is a valuable tool that offers a streamlined and efficient development environment, making it a crucial resource for developers.

Popular Posts