Skip to content

windows subsystem for linux

list your installed distros

powershell
wsl -l

backup a distro

powershell
wsl --export DISTRO_NAME FILENAME.tar

restore a distro

powershell
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

powershell
wsl --mount <DiskPath>

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

to list the available disks in Windows

powershell
wmic diskdrive list brief

the disks paths are available under the DeviceID columns, usually under the \\.\PHYSICALDRIVE0 format.

to unmount and detach the disk

powershell
wsl --unmount <Diskpath>

import any linux distribution to use with wsl

run your distro on podman

bash
podman run -it centos:7 bash

export the container to a .tar file

bash
podman export 8dfcc57ae00d > centos7.tar

on powershell, import the .tar file as a new distro

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