📗
Everyday Cheat Sheets
  • README
  • Build
    • Architecture
      • API Management
        • Kong
      • Authentication
        • Keycloak
        • Okta
      • Cloud Native
      • Design Patterns
      • Design Principles
      • IaC
      • IoT
      • Message Broker
      • Methods
      • Networking
      • Payment
        • Stripe
      • Testing
    • Code lifecycle (ALM)
      • Automation Pipelines
        • Argo CD
        • CircleCI
        • Flux
        • Keptn
        • Travis
      • Azure DevOps
        • Azure Pipelines
      • Chef
      • GitHub
        • GitHub Actions
      • Nexus
      • Promyze
      • RunDeck
      • SaltStack
      • Sonar
      • Tuleap
    • Containers & Cloud Native
      • Argo Workflows
      • Containerization
        • Docker
          • Docker CLI
        • containerd
        • cri-o
      • CNAB
      • Dapr
      • Envoy
      • Fluentd
      • Knative
      • Kubernetes
        • Cluster API
        • etcd
        • Helm
        • k3d
        • kind
        • Kubectl
        • MetalLB
        • Minikube
      • Open Application Model (OAM)
      • Unleash
    • Data storage
      • MySQL
      • MongoDB
        • Atlas
        • Compass
        • Evergreen
        • MongoDB 4.2
        • MongoDB 5.0
        • MongoDB design
        • MongoDB events
        • MongoDB driver for .NET
        • Ops Manager
        • Realm
      • Oracle
      • Redis
      • SQL Server
      • PostgreSQL
    • Frameworks & libraries
      • Angular
        • Angular CLI
        • Angular events
      • .NET
        • ASP.NET Core
        • Blazor
        • .NET 5.0
        • .NET 6.0
        • .NET CLI
        • .NET Core
        • .NET Events
        • .NET Logging
        • .NET Testing
        • NuGet
        • WPF
        • Xamarin
      • gRPC
      • Ionic
      • Jekyll
      • Node.js
        • Express
        • NPM
      • React
        • React Native
      • Redux
    • IDE
      • Visual Studio 2022
    • Languages
      • C#
        • C# 8.0
      • ECMAScript
      • GraphQL
      • JavaScript
        • webpack
        • Yarn
      • MS-DOS
      • PHP
      • PowerShell
      • Python
      • Swagger
      • TypeScript
    • Messaging
      • Azure Service Bus
      • RabbitMQ
    • Testing
    • Workstation
      • QGIS
      • Visual Studio 2019
      • Windows 10
      • Windows Subsystem for Linux
  • Collaborate
    • Marp
    • Microsoft 365
      • Microsoft Graph
      • SharePoint Framework
        • Fluent UI
        • SharePoint Framework UI components
  • Run
    • Cloud computing
      • Alibaba
      • AWS
      • Azure
        • Azure AD
        • Azure CLI
        • Azure Container Registry
        • Azure Portal
        • Azure Service Bus
      • Firebase
      • OVH
    • Hardware
      • Single-board computers
        • Odroid
        • Raspberry Pi
    • Infrastructure automation
      • Azure Resource Manager
      • Packer
      • Pulumi
      • Puppet
      • Terraform
        • HCL
        • Terraform CLI
        • Terraform Providers
    • Networking
      • HAProxy
      • nginx
    • Observability
      • Grafana Labs
        • Grafana
        • Loki
        • Tempo
      • OpenTelemetry
      • Prometheus
      • Splunk
    • Security
      • Falco
    • Systems
      • Linux
        • CentOS
        • eBPF
        • Linux Kernel
        • Rocky
        • Ubuntu
      • Windows Server
    • Virtualization
      • Hyper-V
      • Vagrant
  • Optimize
    • DevOps
  • Join
    • Companies
      • HashiCorp
Powered by GitBook
On this page
  • Installation
  • WSL 2
  • Learn
  • Readings
  • Tips
  • Known issues
  • Recipes
  • Kubernetes
  • Connect to Windows Minikube
  • Connect to Windows Docker (WSL 1)
  • Theming

Was this helpful?

Export as PDF
  1. Build
  2. Workstation

Windows Subsystem for Linux

PreviousWindows 10NextMarp

Last updated 2 years ago

Was this helpful?

→

Installation

→

WSL 2

If your OS version is compatible, you should update to WSL 2:

Learn

→

Readings

  • Microsoft

  • Scott Hanselman

Tips

  • Access Linux files from Windows system: open \\wsl$\Ubuntu\ in Windows Explorer (or %LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows*\LocalState\rootfs)

  • Access Windows files from Linux subsystem: go to /mnt/c/users/<username>

  • Configuration (\\wsl$\Ubuntu\etc\wsl.conf)

[automount]
options = "metadata"

[interop]
appendWindowsPath = false

Known issues

# temporary fix, to be run regularly
sudo hwclock -s
  • Memory issue

wsl --shutdown
  • Zombie process

ps axo stat,ppid,pid,comm | grep -w defunct
sudo kill -9 <pid>

Recipes

Kubernetes

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

Connect to Windows Docker (WSL 1)

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

Theming

Incorrect date with WSL 2: ,

- October 30th, 2019

- April 07, 2020

Docker compose error:

- May 21, 2020

Issues with Minikube and systemd (to be validated against Ubuntu 20.04): , ,

- September 11, 2019

docs.microsoft.com
Installation Guide for Windows 10
Updating the WSL 2 Linux kernel
Microsoft learn > Get started
Windows Subsystem for Linux Documentation
The year of Linux on the (Windows) Desktop - WSL Tips and Tricks
Using Enhanced Mode Ubuntu 18.04 for Hyper-V on Windows 10
issue #5324
issue #4245
Memory Reclaim in the Windows Subsystem for Linux 2
Taking Back Memory From Vmmem/WSL
issue #7899
WSL+Docker: Kubernetes on the Windows Desktop
forum.snapcraft.io
DamionGans/ubuntu-wsl2-systemd-script
snapcraft.ninja
Moving Your JavaScript Development To Bash On Windows
spboyer/dotnetconf-wsl-theme