Windows: expose the engine socket to other WSL distros (WSL integration)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, linux, rust
- Domain
- backend-api-design, infrastructure
Research direction
Start by reading the referenced docs/features.md section on TCP half-close and the existing kiri-start and kiri setup --docker-socket entry points. The report describes the desired mount, socket permissions, distro selection and optional Docker context, but does not identify implementation files or settle the settings and security design. Done would mean opt-in WSL distro integration survives shutdown and daemon restarts and supports the demonstrated Docker CLI and Compose workflows.
Written by the indexing model from the issue text.
Description
What you're trying to do
I develop inside my own WSL2 distro (NixOS; the same goes for Ubuntu and others), and I need the docker CLI and Compose there, with Linux paths for bind mounts.
On Windows, Kiri's Docker API can only be reached from Windows (npipe:////./pipe/kiri). The daemon serves /var/lib/kiri-daemon/.kiri/run/docker.sock inside the kiri distro only, and TCP is deliberately not offered (the half-close issue in docs/features.md), so another distro has no way to reach the engine. Running docker.exe through interop doesn't help, because bind mounts get Windows paths. This is what keeps me on Docker Desktop today.
What you'd like Kiri to do
Docker Desktop handles this with "WSL integration": you pick the distros in Settings, and each one gets the engine's socket.
All WSL2 distros share one kernel and the /mnt/wsl tmpfs, so a unix socket bind-mounted there is reachable from every distro, without touching the network. I tested this by hand:
# in the kiri distro, as root
mkdir -p /mnt/wsl/kiri
mount --bind /var/lib/kiri-daemon/.kiri/run /mnt/wsl/kiri
chgrp 1000 /mnt/wsl/kiri/docker.sock && chmod 660 /mnt/wsl/kiri/docker.sock # 1000 = docker group in my distro
# in another distro, as a regular user in that group
export DOCKER_HOST=unix:///mnt/wsl/kiri/docker.sock
docker run --rm alpine echo hello # prints hello
echo piped | docker run --rm -i alpine cat # prints piped (stdin + half-close work)
docker run -d --name from-nixos alpine sleep 3600 # shows up in Kiri's window and in `docker --context kiri ps` on Windows
Tested with Kiri 0.2.1 and docker CLI 29.9.2 on kernel 6.18.58.1-microsoft-standard-WSL2.
I can't make this stick myself: the mount is lost on wsl --shutdown, the kiri distro is managed by Kiri, and kiri-start recreates the socket, so its group and mode reset whenever the daemon restarts.
Proposal:
- Settings → "WSL integration": an opt-in list of the user's distros, off by default.
- When it's enabled,
kiri-startbinds the run dir to/mnt/wsl/kiri/, and the daemon creates the socket as0660with a fixed group. That's the same model as thekirigroup on Linux ("root-equivalent, exactly like the docker group"). - Optionally, in each enabled distro, create a
kiridocker context, or (opt-in) point/var/run/docker.sockat it, askiri setup --docker-socketdoes on macOS.
Security: the kiri distro stays as locked down as it is now (interop off). This opens no way into that distro beyond the Docker API. It does give container-level root to anyone in the socket's group in any distro of the same WSL VM. Docker Desktop's WSL integration draws the same trust boundary, which is why this should be opt-in.
Would you like to build it?
No, just suggesting it
- Dominant language
- Rust
- Stars
- 7.5k
- Forks
- 329
- Avg merge
- 7h 48m
- Merged PRs (30d)
- 105
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libracoder/kiri
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
libracoder/kiri#364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
libracoder/kiri#289 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 47/100
libracoder/kiri#365 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
libracoder/kiri#362 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 47/100
libracoder/kiri#359 ·
Maintainers usually reply within 1 day
Similar issues
-
benchmark-review
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
area:filesystem bug need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Captions panel does not offer to show an existing transcriptPossibly taken @thedavidweng claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CapSoftware/Cap#4276 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
matrix-org/matrix-rust-sdk#7495 ·
Maintainers usually reply within 1 day