Status: Done (2026-03-24)
Priority: Medium
Component: lib/wsl/docker.ps1, lib/wsl/podman.ps1
Summary:
As a WSL user setting up Docker or Podman, I want /etc/wsl.conf to include [automount] options = "metadata,umask=022" so that Windows-mounted drives have sensible Linux file permissions instead of 0777.
Description:
By default, WSL2 mounts Windows drives (/mnt/c, etc.) without the metadata flag. This means:
- All files appear as
0777(rwxrwxrwx) — no permission differentiation chmod/chownhave no effect on Windows-mounted filesgitinside WSL sees every file as executable, causing noisy diffs- DevPod and similar tools that bridge Windows and WSL filesystems are affected
Adding metadata enables Linux permission metadata on DrvFs mounts. Adding umask=022 sets the standard Linux default (files=644, dirs=755). This was discovered during research into DevPod + Docker/Podman compatibility.
The setting belongs in /etc/wsl.conf (per-distro), not .wslconfig (global). The existing Set-WslConf function already supports merging arbitrary sections, so the implementation is straightforward: add an automount section to the $sections hashtable in both Install-WslDocker and Install-WslPodman.
Acceptance Criteria:
-
Install-WslDockeradds[automount] options = "metadata,umask=022"to wsl.conf when not already present -
Install-WslPodmanadds[automount] options = "metadata,umask=022"to wsl.conf when not already present - Existing user-defined
[automount]options are preserved (not overwritten) - Unit tests cover the new automount section in both docker and podman flows
- All existing tests continue to pass
- Extract
Set-WslConf,Test-WslSystemdConfigured,Test-WslInteropConfigured,Test-WslAutomountConfiguredfromuser.ps1into dedicatedwsl-conf.ps1 - Tests for extracted functions moved to
wsl-conf.Tests.ps1
Technical Notes:
- Wire into the existing
$sectionshashtable pattern in bothInstall-WslDocker(~line 190) andInstall-WslPodman(~line 201) Set-WslConfalready handles section merging and key-level idempotency- The
optionskey value must be quoted:"metadata,umask=022" - Consider whether a
Test-WslAutomountConfiguredcheck function is needed (similar toTest-WslSystemdConfigured)