Linux & WSL
Linux & Windows Subsystem for Linux (WSL) Blog which includes useful guides and troubleshooting tips, written by an experienced Microsoft SQL Server DBA, Peter Whyte.
-
Install a WSL Distro on Another Drive
C: is full and WSL wants to put another virtual disk on it. The WSL install command has a location option that puts a new distro on any drive you choose. The command, the check that it landed there, and what to do about the distros already on C:.
-
Move a WSL Distro Off the C: Drive
A WSL distro is one big vhdx file, and by default it sits on C:. Move it to another drive with the WSL move command, or with export and import on older WSL, without losing what is inside it.
-
Compact a WSL or Docker Desktop vhdx to Get Disk Space Back
C: is full and the biggest file is a WSL or Docker Desktop vhdx that never shrinks. Find it, prune inside, wsl –shutdown, compact it with diskpart, make it sparse, or move it to another drive.
-
Reset or Reinstall WSL Itself, Not Just a Distro
When wsl –shutdown is not enough: back up every distro, try wsl –update, then wsl –uninstall, the 2 optional components, and wsl –install –no-distribution, with the install errors decoded.
-
WSL: The Complete Guide for Windows Admins
Every WSL guide on this site in one place: install, file access, managing distributions, restarting, and the commands worth memorising.
-
How to Back Up and Restore a WSL Distro
A WSL distribution is one command away from being a single tar file you can copy, archive, or restore onto another machine.
-
How to Limit WSL 2 Memory and CPU Usage
WSL 2 will happily take a large share of your RAM and not give it back quickly. A .wslconfig file in your user folder puts a ceiling on it.
-
How to Change the Default User in WSL
WSL logs you in as whichever account you created first. One command changes that, and it no longer needs you to edit a config file inside the distro.
-
How to Install PowerShell on Ubuntu 20.04
This guide will walk you through installing PowerShell on Ubuntu 20.04. I'm doing this on Windows Subsystem for Linux (WSL), and have not encountered any…