Photo - Roseanna Smith
Photo

Windows

Get sudo

You can get sudo working via the "Use Developer Features" hook in the Start Menu. Look for a shield called "Enable Sudo".

It's... just okay.

Use a Package Manager

Use winget if you can!

Use Nushell

winget install Nushell.Nushell

Git

Git on Windows is a... 'special' flower.

winget install Git.Git

On big clones errors like this are common:

$ git clone --recurse-submodules -j16 git@github.com:boop/droop.git
Cloning into 'droop'...
remote: Enumerating objects: 2673758, done.
remote: Counting objects: 100% (49873/49873), done.
remote: Compressing objects: 100% (14594/14594), done.
fetch-pack: unexpected disconnect while reading sideband packetB/s
fatal: fetch-pack: invalid index-pack output

Pass --depth 1 to improve the chance it might succeed. Then:

git fetch --unshallow

Disable Recall

From an administrator terminal:

Dism /Online /Disable-Feature /Featurename:Recall

Disable Start Menu's Bing searches

To disable the Bing searches in the start menu when you start typing (and thus only search the local machine):

powershell -c 'Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Search -Name "DisableSearchBoxSuggestions" -Value 1 -Type DWord'

WSL

The so-called Windows Subsystem for Linux.

Reset WSL2 Quickly

If you're getting Network Unreachable in WSL2 for some reason, try this:

sudo Disable-WindowsOptionalFeature -Online -FeatureName -NoRestart `
    $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")
sudo Enable-WindowsOptionalFeature -Online -FeatureName `
    $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")

Systemd in WSL2

It should 'just work' now, but sometimes you may need to set something in your wsl.conf:

# /etc/wsl.conf
[boot]
systemd=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

[experimental]
sparseVhd=true
            bdd2fe91a05bbcd4b0985af5639435252b217403