In a fresh Windows 11, WSL2 can be installed via command running with privilege mode:
c:\> wsl --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: GUI App Support
[======================== 41.8% ]The command will install a default distro (e.g.: ubuntu) too.
Is there a way to install a WSL2 runtime and environment without any distro?
11 Answer
Of course there's not much you can do with WSL without an actual distribution installed, but sure, you can install the actual WSL2 "runtime and environment" without a distribution.
Just follow the first five steps of Manual installation steps for older versions of WSL. Those steps still work just fine on the current version. A summary of those steps:
Enable WSL: After this step, you will have WSL1 installed. You could, at this point,
wsl --importa rootfs tarball and have a working WSL1 environment.Check requirements for running WSL 2
Enable the Virtual Machine feature. Reboot.
Install the WSL2 Linux kernel package
(Optional) Set WSL 2 as your default version using
wsl --set-default-version 2.
At that point, you have full access to many of the wsl options, but you will be unable to actually start a distribution until you either:
wsl --importa rootfs tarball/distribution- Install a distribution from the Store
wsl install -d <distro>