Reset WSL2 Quickly
If you're getting Network Unreachable
in WSL2 for some reason, try this:
sudo Disable-WindowsOptionalFeature -Online -FeatureName -NoRestart `
sudo Enable-WindowsOptionalFeature -Online -FeatureName `
Systemd in WSL2
It should 'just work' now, but sometimes you may need to set something in your wsl.conf
:
# /etc/wsl.conf
[]
=true
Import WSL2 disks in place
You can just import random vhdx
disks you have with:
wsl --import-in-place ubuntu ext4.vhdx
You don't need to export them or anything, just getting the vhdx
is enough.
You can put them generally anywhere, even some random dev drive.
Sparse WSL2 disks
You can make your WSL2 disks sparse now, saving disk space.
To make a distro sparse:
wsl --manage $DISTRO $ --set-sparse true
Also:
# ~/.wslconfig
[]
=true