/wsl-references

A References Notebook for Windows Subsystem for Linux

WSL References


generic wsl commands

  • finding running distro
wsl --list --running 

How to make backup of existing Distro

1- Get a full list of distro wsl -l -v

2- for backup

 wsl --export (distribution) (filename.tar)

How to restore the wsl distro

wsl --import <DistributionName> <InstallLocation> <FileName>

How to login to wsl with specific Username

wsl -u <username> -d <DistroName>

How to delete WSL Distro

1- get the list of distros (for running stoped distros )

wsl -l -v

2- Run the following command with distro name

wsl --unregister <DistroName>

Login with specific user and folder

wsl -u abdullah -d MLVision --cd /home/abdullah

We can then use this above command as shortcut