Install Windows Linux Subsystem 2 (easy)

With just one command you can run a Linux under current versions of Windows 10 & Windows 11.

Introduction to WSL

Are you using Windows 10 or 11 at the latest feature and patch level? Microsoft recommends version 19041 for Windows 10 or Windows 11. Then you can really use the Windows Linux Subsystem 2 with a command line.

If you follow the Microsoft documentation and execute the command “wsl -install” without parameters, Ubuntu will also be installed.

But let’s first see which distributions are available to us. To do this, execute the following command.

wsl -l --online
Windows Linux Subsysteme – Distributionen that can be installed
Windows Linux Subsysteme – Distributionen that can be installed

Install Ubuntu 24.04

We decide to use Ubuntu 24.04 and therefore use this command.

wsl --install -d Ubuntu-24.04

The installation should now take two to twenty minutes, depending on the hardware.

With Screen to Gif I also have a little video for you.

WSL Installer
WSL Installer

If you now receive an error message, you should check whether virtualization is switched on in the bios. For example, I received the following error message:

image 9
WslRegisterDistribution failed with error: 0x80370102

When you fixed your issues, start Ubuntu again via the Windows 11 start menu and choose an account and password. These are different from your Windows Passwords, so document them carefully.

Test Windows Linux Subsystem in Terminal

Now we have a fully functional Linux Ubuntu Client presenting us with a Bash connected to the network. This is handy for secure SSH connections, testing with Linux or just to use your favorite troubleshooting environment.

Open the terminal and you can now choose a Ubuntu 24.04 option and i.e. use the ping command the Ubuntu 24.04 style.

WSL - Linux Ubuntu Bash in Terminal
WSL – Linux Ubuntu Bash in Terminal

Conclusion

I am a huge fan of running Azure Cloud Shell, Ubuntu Bash, PowerShell and CMD in one screen. Each OS has advantages and features to use, that can be easier used or provide more information.

My orginal version was posted here and check here how to start using Winget. My dev script to setup my dev workstation includes the necessary components already.

Avatar for Andreas Hartig
Andreas Hartig - MVP - Cloud and Datacenter Management, Microsoft Azure

Related Posts

WAU Happy Dragons crazy about 110 percent security

Schedule Winget Auto Updates for operational usage

Deploying Winget Auto Updates (WAU) gives you a functional update baseline, for full functionality we need to configure more to get ready for production. If servers query the Winget repository…

Read more
WAU Happy Dragons about improved security

Centralized Software Patch Management: Deploying Winget Auto Updates (WAU) via Active Directory GPO

Deploying Winget Auto Updates for Software Patch Management for managing third-party software updates across an IT infrastructure typically requires expensive enterprise solutions. This article provides a technical guide on how…

Read more
Gemini Generated Image 6s2cz6s2cz6s2cz6

Active Directory Planning Tool: Mapping Structures and Delegations with SMAD-X

Using an Active Directory Planning Tool is key for understanding complex Active Directory environments and often requires more than what traditional management consoles can provide. While tools such as Active…

Read more
Dragons looking at AccountLockout Tool

AD Account Lockout (Free Tool)

The AD Account Lockout tool is free and very valuable in troubleshooting account lockouts in Active Directory. This is a task as old as the directory service itself. Even in…

Read more
IT Architect doing Active Directory Visualization

Active Directory Visualization (Free Tools)

Designing and documenting Active Directory (AD) structures is always a long and complex exercise. Historically, this required either building full lab environments or settling for static Visio diagrams that became…

Read more
IT Operations Drache looking at Event Logs

Modern Windows Event Viewer – EventLogExpert

The project Windows Event Viewer – EventLogExpert provides a modern open-source toolset that fundamentally improves the way we interact with Windows Event Logs. Since troubleshooting .evtx files is often a…

Read more