Windows Subsystem for Linux (WSL)

List Your Installed Distros

wsl -l

Backup a Distro

wsl --export DISTRO_NAME FILENAME.tar

Restore a Distro

wsl --import DISTRO_NAME INSTALL_LOCATION FILENAME.tar

Mount and Access Other Linux Filesystems

To mount a disk, open a PowerShell window with administrator privileges

wsl --mount <DiskPath>

The mounted path will be available on WSL inside the /mnt/wsl directory.

To list the available disks in Windows

wmic diskdrive list brief

The disk paths are available under the DeviceID column, usually in the \\.\PHYSICALDRIVE0 format.

To unmount and detach the disk

wsl --unmount <Diskpath>

Import Any Linux Distribution to Use With WSL

Run your distro on Podman

podman run -it centos:7 bash

Export the container to a .tar file

podman export 8dfcc57ae00d > centos7.tar

On PowerShell, import the .tar file as a new distro

wsl --import CentOS D:\wslDistroStorage\CentOS .\centos7.tar