• 23 July 2023
  • 185

Install Linux on Windows with WSL: A Guide for Developers

Install Linux on Windows with WSL: A Guide for Developers

Introduction: ⁠

Uncover the Windows Subsystem for Linux (WSL), a potent utility that empowers ⁠ developers to deploy diverse Linux distributions on a Windows PC. Get direct access to Linux applications, utilities, and Bash command-line tools ⁠ on Windows without using a virtual machine or dual boot.

Prerequisites: ​

Ensure you are running Windows 10 version 2004 (Build 19041) or ⁠ higher or Windows 11 to proceed with the WSL installation. ‌

Install WSL Command: ​

With just one command, you can effortlessly install ⁠ WSL in PowerShell or Windows Command Prompt. Execute “wsl –install” as an administrator ⁠ and restart your machine. ​

Change the Default ⁠ Linux Distribution: ‍

The default Linux distribution is Ubuntu, Using the ⁠ “-d” flag allows for changing it. Use “wsl –install -d <Distribution Name>” ⁠ to specify the desired distribution. ​

Set Up Your Linux ⁠ User Info: ‍

After successfully installing WSL, configure an account and password for your Linux distribution ⁠ Consult the Best Practices guide while preparing your WSL development environment. ​

 Task Manager
Image by pch.vector on Freepik

Check WSL Version: ⁠

Find out the installed version of WSL In either PowerShell or Windows ⁠ Command Prompt, execute “wsl -l -v” to retrieve this data. ​

Upgrade WSL Version from ⁠ 1 to 2: ​

Newly installed systems automatically use WSL ⁠ 2 as the default. Perform a Linux distribution upgrade using “wsl ⁠ –set-version <distro name> to version 2”.

Run Multiple Linux Distributions: ​

Savor the freedom of running numerous Linux distributions through the utilization of ⁠ WSL.. Use Windows Terminal for a seamless experience featuring customizable choices. ​

Install
Image by rawpixel.com on Freepik

Try WSL Preview Features: ⁠

Sign up for the Windows Insiders Program in order to ⁠ explore the latest WSL preview features and updates. Customize your build ⁠ channel preference. selecting your preferred channel ⁠ for builds. ​

Conclusion: ‍

Through WSL, developers can leverage the joint strength ⁠ of Windows and Linux on one machine. Install Linux distributions effortlessly, alter the default configurations, and smoothly operate multiple distributions ⁠ with WSL, opening up a world of possibilities for your development environment. ⁠