Differences between revisions 3 and 7 (spanning 4 versions)
Revision 3 as of 2021-07-25 23:43:15
Size: 667
Editor: PieterSmit
Comment:
Revision 7 as of 2022-06-29 00:00:25
Size: 1318
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * Links [[Wsl2/Docker]]
Line 7: Line 9:
== WSL load ssh keys into ssh-agent ==
 * https://esc.sh/blog/ssh-agent-windows10-wsl2/#comment-5518434289
Line 10: Line 14:
 * wsl2 dns broken by windows
   * powershell to find dns servers in use by windows {{{
$x = Get-NetAdapter | Group-Object -AsHashtable -Property ifIndex;
Get-DnsClientServerAddress -AddressFamily ipv4 | where {$x[$_.InterfaceIndex].Status -eq "Up"} | Select-Object -ExpandProperty ServerAddresses | foreach {"nameserver " + $_}
}}}
 * wsl2 windows keep replacing /etc/resolv.conf - prevent it with /etc/wsl.conf {{{
echo "[network]" > /etc/wsl.conf
echo "generateResolvConf = false" >> /etc/wsl.conf
}}}

Linux/Wsl2Windows

  • WSL is a way to run Linux on windows10 machine without installing VM (2020)
  • Links Wsl2/Docker

Basic operrations in Windows

  • wsl --list --all

WSL load ssh keys into ssh-agent

Errors and fix's

  • wsl2 dns broken by windows
    • powershell to find dns servers in use by windows

      $x = Get-NetAdapter | Group-Object -AsHashtable -Property ifIndex;
      Get-DnsClientServerAddress -AddressFamily ipv4 | where {$x[$_.InterfaceIndex].Status -eq "Up"} | Select-Object -ExpandProperty ServerAddresses | foreach {"nameserver " + $_}
  • wsl2 windows keep replacing /etc/resolv.conf - prevent it with /etc/wsl.conf

    echo "[network]" > /etc/wsl.conf
    echo "generateResolvConf = false" >> /etc/wsl.conf
  • mv, even as root, gives error under Windows WSL2
    • possible WSL Windows bug, locking files.
    • Workaround: Close vscode and all WSL windows, open single terminal and do mv / rename
  • Can't ssh - Blocked by FW ??? - https://github.com/microsoft/WSL/issues/5755

  • Cant ping

    $ ping 192.168.20.227
    ping: socket: Operation not permitted
    • Fix add capability, but in WSL debian deployment.

      $ sudo setcap cap_net_raw+p /bin/ping

Linux/Wsl2Windows (last edited 2022-06-29 00:00:25 by PieterSmit)