WSL Basic Commands
September 26, 2024Less than 1 minute
Install Location
C:\Users\Administrator\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx
List all available online version
wsl --list --online
Install online version
wsl --install -d Ubuntu-22.04
List all installed System
wsl --list --verbose
Export installed distribution
wsl --export <DistributionName> <Path\to\file.tar>
Example:wsl --export Ubuntu-20.04 C:\Backups\UbuntuBackup.tar
Unregister installed distribution
wsl --unregister <DistributionName>
Import exported WSL distribution
wsl --import <NewDistributionName> <InstallLocation> <Path\to\file.tar>
Example:wsl --import Ubuntu-Backup C:\WSL\UbuntuBackup C:\Backups\UbuntuBackup.tar
Lunch WSL instance
wsl -d <NewDistributionName>
Shutdown Distribution
wsl -t <NewDistributionName>
Shutdown all linux distributionwsl --shutdown
Start docker-engine
sudo service docker start