Windows 10 and 11: installing WSL2 does not require winget, Chocolatey or Scoop
Posted by jpluimers on 2023/05/18
After using Chocolatey for a long time and writing about it, I have written a few articles on other Windows package managers like winget and Scoop.
Part of the reason was that I wanted to install new systems in a semi-automatic way including WSL2 (Windows Subsystem for Linux 2).
As I have spent quite some time getting treated against metastasised rectum cancer, I missed part of the evolvement of WSL into WSL2 and of the winget evolvement.
The good news is that this simplified the scripted installation of WSL2 a lot, as over time, this got very easy, as confirmed in these posts/messages I found via [Wayback/Archive] winget wsl2 – Google Search:
- [Wayback/Archive] [Package Request] WSL 2 · Discussion #3669 · microsoft/winget-pkgs
wsl --install
is now available in Windows 10 2004 and above. I think that’s a better solution rather than winget having a special case for it. - [Wayback/Archive] How to Install WSL 2 on Windows 10 (Updated) – OMG! Ubuntu!
to install WSL 2 on Windows 10 OS Build 2004 or later you need to open the command prompt app with Administrator permissions, and enter the following command:wsl.exe --install
As soon as you hit enter, the process automatically gets to work. It enables the WSL optional features required, fetches the latest WSL Linux kernel version, and installs Ubuntu as your default distro
I even found back this was announced when I was still in hospital: during the Build 2020 conference. A summary is at [Wayback/Archive] The Windows Subsystem for Linux BUILD 2020 Summary – Windows Command Line describing the introduction of wsl.exe --install
and that it defaults to install WSL 2 as back-then already most Windows Insider build users using WSL had switched from WSL 1 to WSL 2.
Back to installing
Yesterday, in Windows “equivalents” for bash backticks in cmd and PowerShell, I showed how to get the wsl.exe information:
C:\temp>PowerShell -Command "SigCheck "$((Get-Command -CommandType Application wsl).Path)"" Sigcheck v2.82 - File version and signature viewer Copyright (C) 2004-2021 Mark Russinovich Sysinternals - www.sysinternals.com c:\windows\system32\wsl.exe: Verified: Signed Signing date: 09:24 15/10/2021 Publisher: Microsoft Windows Company: Microsoft Corporation Description: Microsoft Windows Subsystem for Linux Launcher Product: Microsoft« Windows« Operating System Prod version: 10.0.19041.1320 File version: 10.0.19041.1320 (WinBuild.160101.0800) MachineType: 64-bit
This was on one of my Windows 10 systems with version 21H2.
The installation progress was as follows and took ome 3 minutes on a 50 Mibit/s fiber connection:
C:\temp>wsl.exe --install Installing: Virtual Machine Platform Virtual Machine Platform has been installed. Installing: Windows Subsystem for Linux Windows Subsystem for Linux has been installed. Downloading: WSL Kernel Installing: WSL Kernel WSL Kernel has been installed. Downloading: Ubuntu The requested operation is successful. Changes will not be effective until the system is rebooted.
Time to play around (:
–jeroen
Leave a Reply