Windows Subsystem (for) Linux

Posts tagged with #wsl
Total: 5

WSL2 & Keychain

Notes | 2022-12-08 (updated 2025-10-25) | 1 min read
#linux #ssh #wsl

The problem

If you use ssh-agent with an encrypted ssh key it does not persist when you open a new terminal window.

The solution

Use keychain instead.

  1. Install
    sudo apt install keychain
    
  2. Add to your shells rc file, eg. .bashrc or .zshrc
    # Repeat this line for all keys you want to unlock and use this way
    /usr/bin/keychain -q --nogui $HOME/.ssh/id_rsa
    source $HOME/.keychain/wsl-sh
    
  3. Unlock your keys on shell startup and enjoy

The WSL Onion

Calling Powershell.exe From PowerShell Inside WSL

Posts | 2022-04-06 (updated 2025-10-22) | 2 min read
#debian #powershell #windows #wsl

The other day I was playing around in WSL with a colleague of mine and we did this:

Read more…

Windows Subsystem for Linux 2: Debian & Podman

Posts | 2022-04-04 (updated 2025-10-22) | 3 min read
#containers #debian #docker #podman #wsl

Stacked containers in a ship yard

The problem: Docker itself can’t be run in WSL2 as it requires the docker daemon, usually run though systemd.

The solution: Podman works just fine and can easily be installed, although we will need to configure some things to make it work properly.

Read more…

Windows Terminal: Open New WSL Tab In Linux Home Folder

Notes | 2021-08-30 (updated 2025-10-25) | 1 min read
#windows #windows-terminal #wsl

The path you are in when opening a new WSL tab is determined by startingDirectory. This parameter needs to be a valid Windows path, which isn’t great if we want to end up in /home/kamner inside WSL.

The nice thing about WSL is that it will resolve windows paths into their equivalent WSL/linux path if possible.

For example, C:\Scripts would resolve to /mnt/c/Scripts.

Using this and the neat trick that the WSL filesystem is exposed as a a hidden fileshare ([[technology/windows/wsl-hidden-fileshare]]) we can get to where we want.

Read more…

Hidden WSL Fileshare

Notes | 2021-08-30 (updated 2025-10-25) | 1 min read
#windows #wsl

WSL file systems get exposed as a hidden share network share: \\wsl$\<WSL Name>\<path\to\file>

For example, my Debian home folder is at: \\wsl$\Debian\home\kamner