Skip to content

nerdctl on windows shows strange warning: failed to remove hosts file for container #4678

@rgl

Description

@rgl

Description

for some reason, on windows 2022, with nerdctl 2.2.1 and containerd 2.2.1, shows this strange warning after a container ends:

level=warning msg="failed to remove hosts file for container "d6e53625b2e9b8cb293dc9363f45564e55a371f3d13c547f2e96c17478513bdb"" error="hosts-store error\nnot found\nGetFileAttributesEx C:\ProgramData\nerdctl\052055e3\etchosts\default\d6e53625b2e9b8cb293dc9363f45564e55a371f3d13c547f2e96c17478513bdb: The system cannot find the file specified."

Steps to reproduce the issue

  1. execute nerdctl run --rm ruilopes/example-docker-buildx-go:v1.12.0
  2. notice that warning showing after the container ends.

Describe the results you received and expected

Here's the output:

vagrant@WINDOWS C:\Users\vagrant>nerdctl run --rm ruilopes/example-docker-buildx-go:v1.12.0
go1.23.0
TARGETPLATFORM=windows/amd64
GOOS=windows
GOARCH=amd64
time="2025-12-28T19:11:05Z" level=warning msg="failed to remove hosts file for container \"d6e53625b2e9b8cb293dc9363f45564e55a371f3d13c547f2e96c17478513bdb\"" error="hosts-store error\nnot found\nGetFileAttributesEx C:\\ProgramData\\nerdctl\\052055e3\\etchosts\\default\\d6e53625b2e9b8cb293dc9363f45564e55a371f3d13c547f2e96c17478513bdb: The system cannot find the file specified."        

Any clue why that happens? I expected to see no warnings or errors on the output.

What version of nerdctl are you using?

vagrant@WINDOWS C:\Users\vagrant>nerdctl version
time="2025-12-28T19:11:54Z" level=warning msg="unable to determine runc version" error="exec: \"runc\": executable file not found in %PATH%"
Client:
 Version:       v2.2.1
 OS/Arch:       windows/amd64
 Git commit:    0d1089396f017bb872ad40606b0d31ebdeaa828a
 buildctl:
  Version:      v0.26.3
  GitCommit:    c70e8e666f8f6ee3c0d83b20c338be5aedeaa97a

Server:
 containerd:
  Version:      v2.2.1
  GitCommit:    dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc:
  Version:

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

vagrant@WINDOWS C:\Users\vagrant>nerdctl info
Client:
 Namespace:     default
 Debug Mode:    false

Server:
 Server Version: v2.2.1
 Storage Driver: windows
 Logging Driver: json-file
 Plugins:
  Log:     fluentd journald json-file none syslog
  Storage: windows-lcow cimfs windows
 Kernel Version:   10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
 Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.4529)
 OSType:           windows
 Architecture:     x86_64
 CPUs:             4
 Total Memory:     4.994GiB
 Name:             windows
 ID:               a137bfb4-940d-480e-a94c-00cb2856a31a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions