Windows

Docker Desktop on Windows 11: bind-mounted project folder returns 'permission denied' after Controlled Folder Access blocks Docker helper processes

viggovpn
1mo ago
Environment

Environment

Windows 11 Pro 22H2, Docker Desktop 4.15.1 using WSL2 backend. Project workspace located at C:\Users\alice\Projects\app and bind-mounted into containers with -v C:\Users\alice\Projects\app:/app. Windows Defender Controlled Folder Access (CFA) is enabled under corporate baseline.

Symptoms

Symptoms

Inside containers, processes fail to write files to the host bind mount with EACCES / 'permission denied' errors when creating logs/temp files. Reads are allowed. Host NTFS ACLs unchanged. Disabling Controlled Folder Access instantly restores write functionality.

Observations

Observations

Windows Defender event logs show 'Controlled folder access blocked' for processes com.docker.backend.exe and wslhost.exe attempting to write to protected folder. Adding 'Docker Desktop' as an allowed app intermittently fails after reboot; some helper binaries run from ephemeral paths so CFA blocks them unpredictably.

Already attempted

Already attempted

Tried resetting Docker Desktop, re-creating mounts, reinstalling Docker, and adding common Docker executables to CFA allowed list (docker-desktop.exe, com.docker.backend.exe). Allow-list entries do not persist for some helper processes. Moving project folder to C:\Projects temporarily resolves the issue.

Question

Question

How can I safely allow containerized workloads to write to host folders without disabling CFA globally and avoid intermittent CFA blocking of Docker helper processes?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

CFA blocking Docker/WSL helper processes writing to protected user folder because helper binaries run from different/executable paths 75%
Writes being performed by wslhost/vmmem processes which are not in the CFA allowed list 60%
Third-party AV or corporate endpoint protection adding additional folder protections 40%

Summary

Controlled Folder Access blocks processes not explicitly allowed from writing to protected user folders. Docker Desktop's orchestration involves multiple helpers (WSL host processes, backend helpers, and transient executables) that perform writes on behalf of containers; CFA may block these because the exact binary path or UAC context differs from the allowed entry. Short-term workable options are: add all relevant host-side executables (com.docker.backend.exe, Docker Desktop.exe, wslhost.exe, vmmem in some setups) to CFA's allowed apps; move project folders out of CFA-protected locations (e.g., to C:\Projects); or use the WSL filesystem (\wsl$) and mount from there. Long-term: ask security team to add a controlled exception for Docker helper paths or adopt a CI-based development workflow that avoids editing files inside protected user folders.

Suggested Fixes

Diagnostic step 1
Temporarily reproduce with CFA off to confirm cause, then re-enable CFA.
Diagnostic step 2
Open Windows Security > Virus & threat protection > Ransomware protection > Allow an app through Controlled folder access. Add: C:\Program Files\Docker\Docker\com.docker.backend.exe, C:\Program Files\Docker\Docker\Docker Desktop.exe, C:\Windows\System32\wslhost.exe. Also add your editor/executor that writes files (e.g., code.exe).
Diagnostic step 3
If writes still block, move the project to a non-protected folder (e.g., C:\Projects) and update bind-mounts.

Continue troubleshooting

Matched from the title, description and tags