Fix "Access is denied" when Docker downloads images on Windows Server
When you install or update Gluesync on Windows Server, Docker can stop partway through downloading the images with a failed to register layer … Access is denied error. This guide shows you how to find what blocks Docker, remove the block, and start Gluesync.
In this guide
-
Recognize the error and understand what causes it.
-
Find the security software or setting that blocks Docker.
-
Exclude Docker from security scanning.
-
Move Docker to a new, empty data folder if the error persists.
-
Start Gluesync and confirm that it runs.
Goal |
Download the Gluesync images and start the platform on a Windows Server host |
Audience |
Windows Server administrators who install or update Gluesync |
Level |
Intermediate |
Time |
15–30 minutes, plus the time your security team needs to add an exclusion |
Area |
Windows Server, Docker Engine, Windows containers |
Applies to |
Gluesync 2.3 kits for Windows containers |
What the error looks like
The error appears while the kit downloads the Gluesync images, for example when you run run.ps1:
failed to register layer: rename C:\ProgramData\docker\image\windowsfilter\layerdb\tmp\write-set-3181704858 C:\ProgramData\docker\image\windowsfilter\layerdb\sha256\8c9d41e5dc497513a5164801f1f02bedbd4a950f37905b159a59dc5258d38eef: Access is denied.
Docker unpacks each image layer into a temporary write-set-<number> folder, then renames the folder to its final name. Windows refuses the rename when another program has a file in that folder open, or when a security policy blocks the change. The cause is on the host, not in Gluesync, and the error often moves to a different layer each time you retry.
The most common causes are:
-
Endpoint security software, such as Microsoft Defender or a third-party antivirus or EDR agent, scanning Docker’s files while Docker writes them.
-
Defender’s Controlled folder access feature blocking
dockerd.exe. -
Half-written layer folders left behind by an earlier, interrupted download.
|
|
Before you begin
-
A PowerShell session opened with Run as administrator.
-
Permission to change Docker Engine settings and restart the Docker service on the host.
-
A contact in the team that manages endpoint security on the host, if a third-party security product is installed.
Guide steps
PowerShell
-
Check Defender’s Controlled folder access setting and its existing exclusions:
Get-MpPreference | Select-Object EnableControlledFolderAccess, ExclusionPath, ExclusionProcess -
Check that exactly one Docker Engine process is running:
Get-Process dockerd -
List the file system filters installed on the host. Security, backup, and replication products each install one:
fltmc -
Compare the
fltmcoutput with the following table.Filter name What it is WdFilterMicrosoft Defender.
ElasticEndpointDriverElastic Defend.
CSAgentCrowdStrike Falcon.
SentinelMonitorSentinelOne.
SysmonDrvMicrosoft Sysmon. It records file activity and blocks files only when its configuration uses file block rules.
bindflt,bfs,CldFlt,FileCrypt,FileInfo,FsDepends,luafv,npsvctrig,storqosflt,UnionFS,wcifs,WofWindows components. These are expected on a Windows container host.
Treat any other filter as a possible cause and identify the product that installed it.
PowerShell
-
If Defender is active, exclude Docker’s data folder and the Docker Engine process. Replace the path if Docker uses a different data folder:
Add-MpPreference -ExclusionPath "C:\ProgramData\docker" Add-MpPreference -ExclusionProcess (Get-Process dockerd).Path -
If Controlled folder access is on, allow the Docker Engine process:
Add-MpPreference -ControlledFolderAccessAllowedApplications (Get-Process dockerd).Path -
If
fltmclists a third-party security product, print the full path of the Docker Engine process:(Get-Process dockerd).Path -
Ask the team that manages that product to trust this process and to exclude Docker’s data folder from scanning. In Elastic Defend, add the process as a trusted application. If Elastic Security shows alerts that blocked
dockerd.exe, also add an endpoint exception for those alerts. -
Restart the Docker service:
Restart-Service docker
|
A Defender exclusion has no effect on a third-party security product. Each product installed on the host needs its own exclusion. |
PowerShell
Do this step if the error comes back after you add the exclusions. A new, empty data folder removes any half-written layers from earlier attempts. It is also a supported way to keep the Docker images, which take several gigabytes, off the system drive.
Choose a folder that meets these conditions:
-
It is on a local NTFS volume. Windows containers do not support ReFS volumes, Dev Drives, network shares, or removable disks.
-
It is outside the Gluesync installation folder.
run.ps1changes the permissions of everything inside the installation folder, which interferes with Docker’s own files. -
It is new and empty. Do not copy the old
C:\ProgramData\dockerfolder into it: Docker downloads the images again.-
Stop the Docker service:
Stop-Service docker -
Create the new folder. This guide uses
D:\docker-data:New-Item -ItemType Directory -Path D:\docker-data -
Open
C:\ProgramData\docker\config\daemon.json, or create it if it does not exist. The file stays in this location after you move the data folder. -
Add the
data-rootsetting, and keep any settings the file already contains. Write each backslash in the path twice:{ "data-root": "D:\\docker-data", "max-concurrent-downloads": 1 }max-concurrent-downloadsis optional. It makes Docker download one layer at a time instead of three, which reduces how many files security software has to scan at once. Downloads take longer. -
Check that the file is valid JSON. The command prints the settings back, or an error that points at the problem:
Get-Content C:\ProgramData\docker\config\daemon.json -Raw | ConvertFrom-Json -
On Docker Engine 23.0 or later, check that Docker accepts the settings. The command prints
configuration OK:dockerd --validate --config-file C:\ProgramData\docker\config\daemon.json -
Start the Docker service:
Start-Service docker -
Confirm the data folder that Docker uses:
docker info --format '{{.DockerRootDir}}' -
Exclude the new folder from security scanning, as in the previous step:
Add-MpPreference -ExclusionPath "D:\docker-data"
-
If the host runs Docker Desktop instead of Docker Engine, add the same settings in Settings > Docker Engine and select Apply & restart.
For all Docker Engine settings on Windows, see Microsoft’s Configure Docker in Windows.
PowerShell
-
Go to your Gluesync installation folder, the folder that contains
run.ps1. The default isC:\Program Files\Gluesync:cd "C:\Program Files\Gluesync" -
Start Gluesync:
.\run.ps1
Troubleshooting
| Problem | Possible cause | What to do |
|---|---|---|
The error still shows |
Docker was not restarted, |
Restart the Docker service and run |
The Docker service stops right after you edit |
The file is not valid JSON, for example because a path contains single backslashes, or a setting refers to something that does not exist |
Open Event Viewer, go to Windows Logs > Application, and look for errors from the source |
The error persists on a new, empty data folder |
A security product still blocks Docker |
Run Microsoft’s Process Monitor with the filter Path contains |
|
The script continues after Docker reports an error |
Scroll up in the PowerShell window for Docker errors, and run |
Related guides
If the error persists, collect the logs with collect-logs.ps1 from the installation folder and open a ticket on the support portal. Include the full error message and the output of fltmc.