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

Skip to content

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Sep 1, 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]>
@vvoland vvoland added this to the 29.0.0 milestone Sep 1, 2025
@vvoland vvoland self-assigned this Sep 1, 2025
Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robmry robmry merged commit d2bb9bd into moby:master Sep 2, 2025
216 of 221 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