Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Sep 2, 2025

Use winio.RunWithPrivileges to get the privileges. It's better because it also locks the Go runtime thread so if the Go scheduler decides to run this code on a different thread, it will still have the expected privileges.

A naive attempt at fixing an error experienced by Docker Desktop user when using Windows containers:

failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessUtilityVMImage \\?\C:\ProgramData\Docker\windowsfilter\<hash1>\UtilityVM: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash2>: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash3>: Access is denied.

Unfortunately I can't reproduce the issue on a Windows VM, but this definitely won't hurt.

At least, I verified that the daemon still works on Windows.

Inspired by: containerd/containerd#8206

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Windows: Potentially fix an issue with "access denied" error when pulling images

- A picture of a cute animal (not mandatory but encouraged)

Use `winio.RunWithPrivileges` to get the privileges.
It's better because it also locks the Go runtime thread so if the Go
scheduler decides to run this code on a different thread, it will still
have the expected privileges.

A naive attempt at fixing an error experienced by Docker Desktop user
when using Windows containers:

```
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessUtilityVMImage \\?\C:\ProgramData\Docker\windowsfilter\<hash1>\UtilityVM: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash2>: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash3>: Access is denied.
```

Unfortunately I can't reproduce the issue on a Windows VM, but this
definitely won't hurt.

At least, I verified that the daemon still works on Windows.

Inspired by: containerd/containerd#8206

Signed-off-by: Paweł Gronowski <[email protected]>
(cherry picked from commit f66f555)
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added this to the 28.4.0 milestone Sep 2, 2025
@vvoland vvoland self-assigned this Sep 2, 2025
@akerouanton akerouanton merged commit 5d5332b into moby:28.x Sep 2, 2025
173 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants