microsoft / microsoft/WSL

Read `wsl-distribution.conf` and `wsl.conf` from `/usr/lib` if not present in `/etc`

Open
#12,299 3 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
Immutable/hermetic Distros may choose to only provide a `/usr` directory and mount other dirs like `/etc` as a tmpfs in which case it is not possible to ship the above config files in their original location

**Describe the solution you'd like**
WSL should fallback to reading the config from `/usr` if it cannot find it in `/etc`. Even better would be to merge the configs if both files are present

**Describe alternatives you've considered**
Do not support hermetic distros

**Additional context**
The most popular example of such a distro is likely the impermanence mode of NixOS but there many custom, specialized distros which go this route. E.g. most immutable distros only provide a `/usr` and only populate `/etc` upon first boot

Contributor guide

Open the contributing guide

Research direction

Start by locating the WSL code that reads /etc/wsl-distribution.conf and /etc/wsl.conf, then inspect any configuration-loading tests. Verify fallback to /usr when the files are absent from /etc; the desired precedence or merge behavior when both locations exist needs clarification before coding.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.