WSL obsolete instructions
Connect to Windows Docker (WSL1)
- In Docker settings, make sure to expose the daemon (in Settings > General > Expose daemon on tcp://localhost:2375 without TLS)
- In Linux, make sure the DOCKER_HOST environment variable is set (
echo $DOCKER_HOST=> localhost:2375)
WSL 2
If your OS version is compatible, you should update to WSL 2.
Known issues
- Incorrect date with WSL 2: issue #5324, issue #4245
# temporary fix, to be run regularly
sudo hwclock -s
- Memory issue
- Memory Reclaim in the Windows Subsystem for Linux 2 - October 30th, 2019
- Taking Back Memory From Vmmem/WSL - April 07, 2020
wsl --shutdown
- Zombie process
ps axo stat,ppid,pid,comm | grep -w defunct
sudo kill -9 <pid>
- Docker compose error: issue #7899
Recipes
Kubernetes
- WSL+Docker: Kubernetes on the Windows Desktop - May 21, 2020
- Issues with Minikube and systemd (to be validated against Ubuntu 20.04): forum.snapcraft.io, DamionGans/ubuntu-wsl2-systemd-script, snapcraft.ninja
Connect to Windows Minikube
- In Windows, look at the kube config
kubectl config view
- In Ubuntu, configure the kube context
kubectl config set-cluster minikube --server=https://127.0.0.1:<port> --certificate-authority=/mnt/c/Users/<username>/.minikube/ca.crt
kubectl config set-credentials minikube --client-certificate=/mnt/c/Users/<username>/.minikube/profiles/minikube/client.crt --client-key=/mnt/c/Users/<username>/.minikube/profiles/minikube/client.key
kubectl config set-context minikube --cluster=minikube --user=minikube
kubectl config use-context minikube
kubectl get nodes
kubectl version
Theming
- Moving Your JavaScript Development To Bash On Windows - September 11, 2019
- spboyer/dotnetconf-wsl-theme
Learn
Readings
- Scott Hanselman
Systemd
- Systemd is Now Available in WSL, a Few Days After Systemd Creator Joins Microsoft by DebugPoint News - September 22, 2022
Configuration
\\wsl.localhost\<linux_distribution>\etc\wsl.confto configure WSL
[automount]
options = "metadata"
[interop]
appendWindowsPath = false
- For old kernels, one can enable compatibility with iptables:
sudo update-alternatives --config iptables