Skip to content

Hyper-V isolation: starting a stopped container again fails with failed to add SCSI scratch VHD ... c:\mounts\scsi\m0 ... The directory is not empty #2973

Open

Description

@g-chauvel

With Hyper-V isolation and the io.containerd.runhcs.v1 runtime, a Windows container based on an ltsc2025 image runs once, then cannot be started again:

failed to create task for container: failed to create shim task: failed to mount container storage: failed to add SCSI scratch VHD: mount scsi controller 0 lun 1 at c:\mounts\scsi\m0: guest RPC failure: The directory is not empty.

With "debug": true, the dockerd log of the failed start contains:

onecore\vm\compute\management\orchestration\vmhostedcontainer\vmhostedcontainerstorage.cpp(418)\vmcomputeagent.exe!00007FF7D0883CEE: (caller: 00007FF7D0875C49) Exception(1) tid(3f4) 80070091 The directory is not empty.

Steps to reproduce

Docker daemon configuration:

{
  "features": { "containerd-snapshotter": true },
  "default-runtime": "io.containerd.runhcs.v1"
}
docker run --name repro mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c echo hello
docker start -a repro
hello
Error response from daemon: failed to create task for container: failed to create shim task: failed to mount container storage: failed to add SCSI scratch VHD: mount scsi controller 0 lun 1 at c:\mounts\scsi\m0: guest RPC failure: The directory is not empty.

A restart policy gets the same error:

docker run -d --name restart-policy --restart on-failure:3 mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo run & exit 1"
docker inspect restart-policy --format '{{.State.Status}} {{.RestartCount}} {{.State.Error}}'
exited 1 failed to create task for container: failed to create shim task: failed to mount container storage: failed to add SCSI scratch VHD: mount scsi controller 0 lun 1 at c:\mounts\scsi\m0: guest RPC failure: The directory is not empty.

Results

Same steps (docker run then docker start -a) with the binaries listed below:

containerd-snapshotter default-runtime Image Isolation docker start
true io.containerd.runhcs.v1 nanoserver:ltsc2025 hyperv fails
true io.containerd.runhcs.v1 nanoserver:ltsc2022 hyperv works
true io.containerd.runhcs.v1 nanoserver:ltsc2025 process works
false io.containerd.runhcs.v1 nanoserver:ltsc2025 hyperv fails
false com.docker.hcsshim.v1 nanoserver:ltsc2025 hyperv works

Environment

  • Windows 11 Pro 26H2, OS build 26300.9711, default isolation hyperv
  • Images:
    • mcr.microsoft.com/windows/nanoserver:ltsc2025 (10.0.26100.33650), sha256:4d81c65bfec7e1b00e004ba8d7306347a880935179bc20cae1044b5a7d35f789
    • mcr.microsoft.com/windows/nanoserver:ltsc2022 (10.0.20348.5761), sha256:32729e1cdc6718c90952375e9bbae2b2c5d38f41ceb50a693fc2383b76df28fd
  • Binaries built from the default branches:
    • docker/cli 6d274590f2
    • moby b711d217
    • containerd 57d315c6e
    • hcsshim 838c219 (containerd-shim-runhcs-v1.exe)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions