Wsl2

13 Sep 2022

WSL DNS Issue

Out of the blue a problem resolving common domains popped up while I was using a WSL Linux image.

Some internet searching led me to this:

https://gist.github.com/coltenkrauter/608cfe02319ce60facd76373249b8ca6

The Github gist and the comments had me scared, but poking around in the Linux system running under WSL indicated that /etc/resolv.conf was symlinked to some non-existing file. This was probably something that WSL is doing under the hood based on its own configuration judging by the link.

15 Apr 2022

Reclaim Docker WSL Disk Space

I ran out of system SSD disk space on my Win10 PC at home and tracked a large share of the usage to a vhdx virtual disk image file in a Docker Desktop folder. Below is the summary of what I found.

Docker Desktop for Windows uses WSL to manage all your images and container files and keeps them in a private virtual hard drive (VHDX) called ext4.vhdx.

It’s usually in C:\Users\YOURNAME\AppData\Local\Docker\wsl\data and you can often reclaim some of the space if you’ve cleaned up (pruned your images, etc) with Optimize-Vhd under an administrator PowerShell shell/prompt.