Category: 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.
-
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 Move a WSL Distro to Another Drive
WSL installs onto C: by default and the virtual disk only grows. Moving a distribution to another drive used to be a three-step dance. It is now one command.
-
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…
-
How to Restart Windows Subsystem for Linux (WSL)
If your Windows Subsystem for Linux (WSL) instance encounters errors or you’ve updated the .wslconfig file (e.g., to modify memory limits), restarting your WSL…
Three guides collect the posts by the job you are doing rather than by date.
PowerShellFiles, CSVs, the firewall, scheduled tasks WSLInstalling it, distros, files across both worlds Windows AdministrationServers, domains, DNS, the tools worth havingThis site started as a SQL Server blog in 2017 and the archive is still here. The new SQL Server writing, and all the scripts, moved to a site of their own.
sqldba.blogScripts, error library, wait types, SSMS- Install Claude Code on Windows, Native and in WSL
- Claude Code Only Keeps 30 Days of Transcripts
- Compact a WSL or Docker Desktop vhdx to Get Disk Space Back
- Reset or Reinstall WSL Itself, Not Just a Distro
- Install PowerShell 7 on Windows and Keep Windows PowerShell 5.1
- SSH Keys for GitHub on Windows With the OpenSSH Agent
- Linux & WSL (31)
- Microsoft SQL Server (51)
- Other (15)
- PowerShell (54)
- Windows Server Admin (40)