{
  "id": "docker/volume-mount-permission-denied-windows",
  "signature": "Error response from daemon: error while mounting volume '/host_mnt/c/Users/user/data': permission denied",
  "signature_zh": "来自守护进程的错误响应：挂载卷 '/host_mnt/c/Users/user/data' 时出错：权限被拒绝",
  "regex": "error while mounting volume '/host_mnt/[^']+': permission denied",
  "domain": "docker",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "On Docker Desktop for Windows, bind mounts from the C drive require shared drive permissions; if the drive is not shared or the user lacks access, mounting fails with permission denied.",
  "root_cause_type": "generic",
  "root_cause_zh": "在适用于 Windows 的 Docker Desktop 上，从 C 盘进行的绑定挂载需要共享驱动器权限；如果驱动器未共享或用户无访问权限，挂载将失败并返回权限被拒绝。",
  "versions": [
    {
      "version": "Docker Desktop 4.19.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Docker Desktop 4.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Windows 10 21H2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Windows 11 22H2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running Docker Desktop as Administrator",
      "why_fails": "Even as Administrator, the C drive must be explicitly shared in Docker Desktop settings; admin privileges alone do not bypass the sharing requirement.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Changing file permissions on the host folder using icacls",
      "why_fails": "Docker Desktop uses a virtual filesystem (gRPC FUSE) to mount Windows paths; host NTFS permissions are not the primary issue—the Docker service itself needs share access.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a relative path instead of absolute path in docker run -v",
      "why_fails": "Relative paths are resolved relative to the current directory, but if the resolved absolute path is still on a non-shared drive, the same error occurs.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Share the C drive in Docker Desktop: Settings > Resources > File Sharing > add 'C:\\' and apply. Then restart Docker Desktop and retry the mount.",
      "success_rate": 0.85,
      "how": "Share the C drive in Docker Desktop: Settings > Resources > File Sharing > add 'C:\\' and apply. Then restart Docker Desktop and retry the mount.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Move your project folder to a drive that is already shared (e.g., D:\\) or to the user profile directory under C:\\Users\\ which is often shared by default.",
      "success_rate": 0.75,
      "how": "Move your project folder to a drive that is already shared (e.g., D:\\) or to the user profile directory under C:\\Users\\ which is often shared by default.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a named volume instead of a bind mount: 'docker volume create mydata' and then 'docker run -v mydata:/app/data' to avoid host filesystem permission issues.",
      "success_rate": 0.7,
      "how": "Use a named volume instead of a bind mount: 'docker volume create mydata' and then 'docker run -v mydata:/app/data' to avoid host filesystem permission issues.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 Docker Desktop 中共享 C 盘：设置 > 资源 > 文件共享 > 添加 'C:\\' 并应用。然后重启 Docker Desktop 并重新尝试挂载。",
    "将项目文件夹移动到已共享的驱动器（例如 D:\\）或默认共享的用户配置文件目录 C:\\Users\\ 下。",
    "使用命名卷代替绑定挂载：'docker volume create mydata' 然后 'docker run -v mydata:/app/data' 以避免主机文件系统权限问题。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.docker.com/desktop/settings/windows/#file-sharing",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.78,
  "resolvable": "partial",
  "first_seen": "2023-04-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}