The Operator’s WSL Bible

Windows Subsystem for Linux: a practical way to run Linux on Windows.
Run Linux GUI applications – through WSLg.

There are situations when a powerful Linux desktop is not given.
In this case WSL can provide some Linux tooling and flexibility.

Operators don’t break. We bend – we adapt.

Install And Update WSL On Windows 11

To install WSL open PowerShell as Administrator and run:

wsl --install

Restart your machine after the operations.

To update an existing WSL system run:

wsl --update

Deploy The First Distro

If the network allows – WSL can list the available distros for installation:

wsl --list --online

To install a new WSL distro:

wsl --install <distro> # e.g. Ubuntu, Debian

You can list the installed distros:

wsl --list --verbose

Configure the default distro:

wsl --set-default <distro>

Remove A Distro

This command will try to remove the virtual disk and metadata of the distro:

wsl --unregister <distro>

Start / Stop

You can start or stop WSL distros individually.

To start a distro and launch a shell:

wsl --distribution <distro>

# or

wsl -d <distro>

List the running distros:

wsl --list --running

Stop a distro gracefully:

wsl --terminate <distro>

Or stop all running distros:

wsl --shutdown

Export A Distro (Backup)

Export a distro to an archive – the best way to back it up with data and metadata.

You can export a WSL distro:

wsl --export <distro> <backup_file>

Set up the export format with:

wsl --export <distro> <backup_file> --format [tar | tar.gz] # if supported

Store the archive securely on an external device, or off-site.

Import (Restore)

You can import a backup archive multiple times. This way you can have multiple instances of the same distro.

To import a backup run:

wsl --import <distro> <install_location> <backup_file>

Final Thoughts

WSL is a nice touch on Windows for operators who are restricted to this environment. The native Linux tooling and filesystem access makes it a comfortable system.

Operators don’t break under the pressure: we bend – we adapt.

Leave a comment