Manage WSL

Here's a list of the most common used commands to manage WSL. You must run these commands in Powershell.

View a list of commands

wsl --help

Install a distro

wsl --install <distro>
Example
wsl --install kali-linux

View a list of distros installed in WSL

wsl --list

Set the default distribution to use

wsl --set-default <distro>

When you use the command wsl alone, it will run the selected default distro in the current directory.

Run a specific distro

Run a distro in specific directory

Finalize all running distros and close WSL

Export a WSL distro (backup)

Where <distro> is the name of the distribution you want to export, and <filename> the address where the .tar file will be exported.

Import a WSL distro

Where <distro> is the name of the distribution (it can be anything), <install_location> is the address where the filesystem will be installed, and <filename> is the address where the exported .tar file is located.

Delete a WSL distro

Last updated