How to install Linux WSL2 on Windows 10 and Windows 11 (2024)

How to install Linux WSL2 on Windows 10 and Windows 11 (1)

Jump to:

  • Simplified setup
  • WSL1 component
  • Choosing WSL2
  • Listing WSL distros
  • Changing WSL version
  • Launch in PowerShell

Microsoft dropped plenty of jaws when it launched the Windows Subsystem for Linux, a way to run actual Linux inside Windows without the need to set up a virtual machine. The project has seen a ton of support, and WSL2 is the latest and greatest.

It takes things a little further and adds yet more awesomeness to the Linux experience on Windows 10 and Windows 11. Now, since the release of version 1.0, it has never been easier to set up WSL2 on your Windows machine, with GUI apps now even supported on Windows 10, too.

Simplified setup of WSL2 on Windows 10 and Windows 11

How to install Linux WSL2 on Windows 10 and Windows 11 (2)

There is now a new, extremely simplified way to get WSL2 up and running on your Windows 10 and Windows 11 PC. To get the very latest version you need to be running Windows 10 version 21H1, 21H2, or 22H2, or on Windows 11 21H2 with all of the November updates applied.

Once this is in place, open up PowerShell and enter this command:

wsl --install

That's it. The setup process will begin, and you can relax until it's finished. By default, WSL will enable all system features required and it will download and install Ubuntu. If you don't want a distribution installed during setup you can add the -- no-distribution tag to the installation command.

Alternatively, if you want a non-Ubuntu distribution installed you can add its name after the install command. For example, wsl --install Debian.

WSL is now distributed through the Microsoft Store and the simplified installation process will pull this version in. Alternatively, you can download it directly from its Microsoft Store listing.

Get the Windows Central Newsletter

All the latest news, reviews, and guides for Windows and Xbox diehards.

You will also require the optional Windows Subsystem for Linux component if you wish to also use WSL 1 alongside WSL 2.

How to enable Windows Subsystem for Linux optional component for WSL 1

WSL2 is now the standard, but if for any reason you also want to use WSL1 alongside it, you'll need the optional Windows Subsystem for Linux component enabling. Fortunately, you can do this in two ways. The first is by adding --enable-wsl1 to the install command used above.

But you can also enable the component at any time, even after you already have WSL2 up and running. Open PowerShell as administrator and enter this command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Eventually, you will need to reboot your PC, adding norestart means you won't be immediately kicked out of whatever you're doing. If you want to reboot immediately, simply omit this from the end of the command.

Setting WSL2 for your Linux distros

The good thing about WSL2 is that it doesn't replace WSL1. It just runs alongside it. This means you can run Linux installs with a combination of different versions. You're able to set either as default as well as setting a version specifically to each Linux distro you have on your PC.

How to install Linux WSL2 on Windows 10 and Windows 11 (3)

If you want everything to run on WSL2 as soon as you install it, you can set it as the default version.

wsl --set-default-version 2

Listing installed Linux distros and their WSL version

How to install Linux WSL2 on Windows 10 and Windows 11 (4)

With WSL2 set as default, any Linux installs after that will use it automatically. You can easily check which version of WSL your installed Linux distros are using.

wsl --list --verbose 

Using the verbose flag will give you the breakdown of which version of WSL is attached to which Linux installation. Without it, you'll simply get a list of the versions of Linux you have installed.

Changing the version of WSL per Linux installation

How to install Linux WSL2 on Windows 10 and Windows 11 (5)

While setting WSL2 as default will apply it to anything you install afterward. If you're already set up, you'll need to manually convert. Likewise, if you wish to go between versions 1 and 2 or run a mixture on your system, you can do that.

wsl --set-version <distribution name=""> <versionnumber></versionnumber></distribution>

So, as an example, if you have a Debian installation on WSL that you need to convert to WSL2, you'd enter

wsl --set-version debian 2

Launch specific Linux installations in PowerShell

How to install Linux WSL2 on Windows 10 and Windows 11 (6)

If you only have one version of Linux installed, simply typing

wsl

in PowerShell will launch you into the associated bash shell. But if you have multiple, you can launch a specific distro with this command.

wsl -d <distribution name=""></distribution>

Once you're done, typing

exit

will take you back into PowerShell.

From here on out, you're ready to go forth and install all the Linux you want. Our full guide will help you along the way, but once WSL2 is set up how you like it, it just fades into the background.

It's also worth grabbing the Windows Terminal app from the Microsoft Store if you're using WSL. While you can just use the standard terminal installed with each or launch through PowerShell as shown above, Windows Terminal has a neat, tabbed interface that lets you run multiple shells at once. Have PowerShell, Linux, Azure Cloud Shell, and even Command Prompt, all open together side-by-side in one window.

How to install Linux WSL2 on Windows 10 and Windows 11 (7)

Richard Devine

Managing Editor - Tech, Reviews

Richard Devine is a Managing Editor at Windows Central with over a decade of experience. A former Project Manager and long-term tech addict, he joined Mobile Nations in 2011 and has been found on Android Central and iMore as well as Windows Central. Currently, you'll find him steering the site's coverage of all manner of PC hardware and reviews. Find him on Mastodon at mstdn.social/@richdevine

How to install Linux WSL2 on Windows 10 and Windows 11 (2024)
Top Articles
Good Morning Greetings Animated
Azeroth Auto Pilot ? sur le forum World of Warcraft Classic - 04-09-2019 08:37:38
Genesis Parsippany
How To Do A Springboard Attack In Wwe 2K22
Free Atm For Emerald Card Near Me
Gunshots, panic and then fury - BBC correspondent's account of Trump shooting
Ncaaf Reference
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Danielle Longet
Craigslist Dog Kennels For Sale
R/Altfeet
Blog:Vyond-styled rants -- List of nicknames (blog edition) (TouhouWonder version)
Huge Boobs Images
Sivir Urf Runes
Wisconsin Women's Volleyball Team Leaked Pictures
50 Shades Darker Movie 123Movies
Metro Pcs.near Me
What Is Vioc On Credit Card Statement
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Kcwi Tv Schedule
Conan Exiles Sorcery Guide – How To Learn, Cast & Unlock Spells
Clare Briggs Guzman
Sullivan County Image Mate
Used Safari Condo Alto R1723 For Sale
Azur Lane High Efficiency Combat Logistics Plan
Craigslist Illinois Springfield
Walgreens Bunce Rd
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Craigslist Lake Charles
1145 Barnett Drive
Skepticalpickle Leak
Uno Fall 2023 Calendar
Desales Field Hockey Schedule
Devargasfuneral
O'reilly's Wrens Georgia
EST to IST Converter - Time Zone Tool
All Things Algebra Unit 3 Homework 2 Answer Key
Kelly Ripa Necklace 2022
Boone County Sheriff 700 Report
Cygenoth
Craigslist Com Panama City Fl
Cnp Tx Venmo
Nail Salon Open On Monday Near Me
Frigidaire Fdsh450Laf Installation Manual
Is Ameriprise A Pyramid Scheme
Used Auto Parts in Houston 77013 | LKQ Pick Your Part
Tyrone Dave Chappelle Show Gif
Grandma's Portuguese Sweet Bread Recipe Made from Scratch
Tenichtop
Loss Payee And Lienholder Addresses And Contact Information Updated Daily Free List Bank Of America
Elizabethtown Mesothelioma Legal Question
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 5630

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.