Managing Windows subsystem for Linux (WSL)

If you activate the WSL Windows feature, images and config will reside under %userprofile%\AppData\Local\Packages

Some simple powershell commands for managing WSL

List images

wsl -l -v

Uninstall an image:

wsl --unregister kali-rolling
removes your image of choice

Backup your image:

wsl --export <distro> <filename.tar>

Import your image:

wsl --import <distro> <install location> <filename> 

Upgrade WSL version:

wsl --set-version <distro name> 2

Stop WSL:

wsl --shutdown

Kali Linux specific tip:

Run Kali in a nice desktop experience https://www.kali.org/docs/wsl/win-kex/

More articles

Optional features

Check available optional features: DISM /Online /Get-Capabilities Install an optional feature: DISM /Online /Add-capability /capabilityname:Media.MediaFeaturePack~~~~0.0.1.0

Read More »

AD retention period

Check AD retention tombstone value: Import-Module ActiveDirectory $ADForestconfigurationNamingContext = (Get-ADRootDSE).configurationNamingContext $DirectoryServicesConfigPartition = Get-ADObject -Identity “CN=Directory Service,CN=Windows NT,CN=Services,$ADForestconfigurationNamingContext” -Partition $ADForestconfigurationNamingContext -Properties *

Read More »