Using WSL (Windows Subsystem for Linux) to extend your your Windows experience

Share on:

WSL - Windows Subsystem for Linux

Overview

Windows Subsystem for Linux is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. In May 2019, WSL 2 was announced, introducing important changes such as a real Linux kernel, through a subset of Hyper-V features.

Also known as WSL, it has revolutionized the way I interact with my environment in Windows. In my case, i’m primarily using Ubuntu 20.04:

tdieter@d-desktop:/coderepo/troydieter.com$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

In addition to Ubuntu, there is multiple Linux distributions to choose from:

Windows Subsystem for Linux allows me to run all my native tools to Linux that i’m accustomed to.

Backups

Backups of the environment (can) still be a manual process. When backed up, it makes it easier to migrate to other machines or disaster recovery.

General practice for backups:

rsync --archive --verbose --delete /home/yourhomeusername/ /mnt/c/Users/yourwindowsusername/wsl2-backup/

Thanks to Stephen’s Thoughts, he has an automated way to perform these backups using a bash script (look towards the bottom).

Installation

As referenced by the official Microsoft documentation, please use the following to install WSL2.