Skip to content
Back to skills

Docker Wsl2 Integration

BSecurity

Use when configuring Docker Desktop WSL2 backend on Windows.

  • 2 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 10, 2026
ai-agentsgoshellbashdockergitbackendperformance

Security analysis

B88/100
  • criticalModifies startup scripts or system services for persistence

Pro shows the line behind each finding and how to fix it

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill docker-wsl2-integration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docker Wsl2 Integration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docker Wsl2 Integration
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-docker-wsl2-integration/badge)](https://www.skillsdirectory.com/skills/loopyluci-docker-wsl2-integration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docker-wsl2-integration
description: "Use when configuring Docker Desktop WSL2 backend on Windows."
category: docker
tags: [docker, wsl2, windows, integration, gpu, daemon]
---

# Docker WSL2 Integration

Configuring Docker Desktop's WSL2 backend on Windows.

## Architecture

Docker Desktop on WSL2 uses two internal WSL2 distros:
- **`docker-desktop`** — the Docker engine/daemon
- **`docker-desktop-data`** — images, volumes, build cache (VHDX)

## Enable & Verify

### Through Docker Desktop Settings
Settings → Resources → WSL Integration → Enable with default WSL distro → Apply

```powershell
# Verify from Windows
docker ps
# Verify from WSL2
wsl -d Ubuntu docker ps
```

## TCP Daemon Access

```powershell
# Settings → General → "Expose daemon on tcp://localhost:2375 without TLS"
$env:DOCKER_HOST = "tcp://localhost:2375"

# Or set in ~/.bashrc
echo 'export DOCKER_HOST=tcp://localhost:2375' >> ~/.bashrc
```

## File Sharing Performance

```powershell
# /mnt/c/ is SLOW for Docker mounts — keep code in WSL2 filesystem
cd ~
mkdir project && cd project
git clone <repo>
docker compose up   # fast

# WSL2 files visible from Windows at:
# \\wsl.localhost\Ubuntu\home\user\
```

## GPU Passthrough

```powershell
# Install NVIDIA drivers on Windows (covers WSL2 too)
docker run --gpus all nvidia/cuda:12.2-runtime-ubuntu22.04 nvidia-smi

# Vulkan in WSL2
docker run --gpus all -it ubuntu-vulkan vkcube
```

## Docker Engine Inside WSL2 (Without Docker Desktop)

```bash
sudo apt-get update && sudo apt-get install -y docker.io docker-compose-v2
sudo usermod -aG docker $USER
sudo dockerd &
```

## Troubleshooting

```powershell
# Check WSL2 status
wsl --list --verbose
# Restart WSL2 entirely
wsl --shutdown
# Check Docker Desktop logs
Get-Content "$env:LOCALAPPDATA\Docker\log\*.log" -Tail 50
```

## Pitfalls

- **DrvFs mounts** are slow — keep code in WSL2 filesystem
- **`wsl --shutdown`** kills docker-desktop distros
- **VPNs** can break WSL2 networking — `wsl --shutdown` then restart
- **docker-desktop-data VHDX** can grow huge — compact with diskpart or reset
- **Docker context** may switch between Windows and WSL2 — check with `docker context ls`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.