Windows Subsystem for Linux
https://learn.microsoft.com/en-us/windows/wsl/
Get the size of WSL distribution disks
Section titled “Get the size of WSL distribution disks”- Get the name of the distribution:
Terminal window wsl --list - Insert it in the following command to get the filename:
Terminal window (Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq '<distribution-name>' }).GetValue("BasePath") + "\ext4.vhdx" - Check the filesize using PowerShell or Windows Explorer.
Using the Windows OpenSSH Agent from WSL
Section titled “Using the Windows OpenSSH Agent from WSL”- Install
socatin the WSL distro:
sudo apt install socat- Install
npiperelayin Windows:
choco install npiperelay- Insert into
~/.bashrcin the WSL distro:
# Configure ssh forwardingexport SSH_AUTH_SOCK=$HOME/.ssh/agent.sock# need `ps -ww` to get non-truncated command for matching# use square brackets to generate a regex match for the process we want but that doesn't match the grep command running it!ALREADY_RUNNING=$(ps -auxww | grep -q "[n]piperelay.exe -ei -s //./pipe/openssh-ssh-agent"; echo $?)if [[ $ALREADY_RUNNING != "0" ]]; then if [[ -S $SSH_AUTH_SOCK ]]; then # not expecting the socket to exist as the forwarding command isn't running (http://www.tldp.org/LDP/abs/html/fto.html) echo "removing previous socket..." rm $SSH_AUTH_SOCK fi echo "Starting SSH-Agent relay..." # setsid to force new session to keep running # set socat to listen on $SSH_AUTH_SOCK and forward to npiperelay which then forwards to openssh-ssh-agent on windows (setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &) >/dev/null 2>&1fiSource: https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/
Enabling systemd in WSL2
Section titled “Enabling systemd in WSL2”- Edit
/etc/wsl.confas root:[boot]systemd=true