Skip to main content

WSL Windows subsystem for linux

install

manual

backup and restore

xda developers

commands from link:

# backup
wsl -l
wsl --export (distribution) (file path)

# remove
wsl -v
#-> uninstall dist form startmenu
wsl --unregister <distribution>

# restore
wsl --import (distribution) (install location) (file path)
wsl --distribution (distribution)

move / clone distribution

not tested !!!

wsl --export Debian C:\temp\Debian.tar
wsl --import MovedDebian C:\WSL\Debian C:\temp\Debian.tar --version 2
wsl --distribution MovedDebian

settings

Mirrored Mode WSL2 Networking

from superuser.com

Note: Requires Windows 11 23H2 or later

In Mirrored mode, localhost should "just work". To enable:

  • Add the following to your <windows_user_profile>/.wslconfig:

    [wsl2]
    networkingMode=mirrored
    #autoProxy=false # only if necessary ?
    
  • Exit your WSL distribution

  • Run wsl --shutdown from PowerShell then restart WSL

You should then be able to access services running in Windows via localhost.

Note that when running in Mirrored mode, mDNS will not work.

hosts configs:

edit C:\Windows\System32\drivers\etc\hosts in admin mode add:

127.0.0.1	shop.local

non mirrored wsl2 mode

  • simple check that the ./wslconfig file is empty or at least networkingMode=mirrored is not set.

  • check the im address: wsl hostname -I

TODO