WSL
Backup and Restore WSL
Listing Running Distros
wsl --list --verboseStarting/Restarting a Distro
wsl --distribution DISTRO-NAMETerminate a Running Distro
wsl --t DISTRO-NAMETerminate All Running Distros and WSL process
wsl --shutdownBackup a WSL Distro
wsl --export (distribution) (filename.tar)Restore a WSL Distro from Backup
wsl --import (distribution) (install location) (file location and filename)Symbolic Links
Link .ssh folder
sudo ln -s /mnt/c/Users/lempa/.ssh ~/.sshLink .kube folder
sudo ln -s /mnt/c/Users/lempa/.ssh ~/.sshFile Permissions
Advanced settings configuration in WSL: WSL Config Parameters
Example wsl.conf
[automount]
enabled = true
options = "metadata,uid=1000,gid=1000,umask=077,fmask=11,case=off"
mountFsTab = true
[interop]
enabled = false
appendWindowsPath = falseNetworking
Port Forwarding
Find IP Address
bash.exe -c "ifconfig eth0 | grep 'inet '"Add PortForwarding
$port = 8080
$remoteaddr = 0.0.0.0
netsh interface portproxy add v4tov4 listenport=$port connectport=$port connectaddress=$remoteaddr
netsh advfirewall firewall add rule name=$port dir=in action=allow protocol=TCP localport=$portDelete PortForwarding
$port = 8080
netsh interface portproxy delete v4tov4 listenport=$port
netsh advfirewall firewall delete rule name=$portShow PortForwardings
netsh interface portproxy show v4tov4Linux desktop in WSL2
With WSL2 it’s possible to install and run a Linux desktop environment (XFCE). A tutorial on how to implement that, can be found here.
Last updated on