Introduction
WSL lets you run Linux on your Windows machine, giving you access to the best of both worlds for development.
Get an awesome tool: WSL
To install WSL, open the terminal and run the following command:
wsl --install --no-distribution
This command installs WSL without the default Ubuntu distribution. If the wsl
command doesn't work use wsl.exe
instead.
Restart your computer, to complete the installation.
To check the list of available distributions, run:
wsl --list --online
You should see something like this:
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
Ubuntu-24.04 Ubuntu 24.04 LTS
OracleLinux_7_9 Oracle Linux 7.9
OracleLinux_8_7 Oracle Linux 8.7
OracleLinux_9_1 Oracle Linux 9.1
openSUSE-Leap-15.6 openSUSE Leap 15.6
SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5
SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6
openSUSE-Tumbleweed openSUSE Tumbleweed
Install one of these distributions with:
wsl --install <Distro>
This command will install your chosen distribution. For getting familiar with WSL, Ubuntu or Debian are good starting points.
When installed, you have to choose username and password.
If you install multiple distributions, you can set a default with:
wsl --set-default <DistributionName>
Setting a default distribution ensures that when you open WSL without specifying a distribution it will start your preferred environment.
You can either start the distribution, you can use the current working directory or the distribution's user home directory:
- Current working directory:
wsl
- User's home directory:
wsl ~
To list the installed distributions, run:
wsl --list --verbose
Check the running distributions:
wsl -l --running
Stop a running distribution:
wsl --terminate <Distribution Name>
WSL is a powerful tool that brings the Linux experience directly into Windows, allowing for a flexible development environment.
Top comments (2)
Do you want a better advice?
For quite some time to get your hands dirty, use WSL. After a few months just use your choice of linux distro full time.
Windows and Linux together does not go well.
Another alternative is to use HyperV to manage virtual machines. You can install any distro you like and works much closer to the native experience.