Skip to main content

WSL Windows subsystem for linux

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
    
  • 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.