You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker卷挂载疑问:Windows10下VirtualBox版Docker挂载点无法找到

Understanding Docker Volumes with VirtualBox-based Docker on Windows 10

Hey there! Let's clear up the confusion around your Docker volume setup—this is a super common gotcha when using the VirtualBox-backed Docker Toolbox on Windows, so you're not alone here.

Why you can't find the /mnt/sda1/var/lib/docker/volumes/my_vol/_data path on Windows

First, let's break down the architecture:

  • When you use Docker Toolbox (the VirtualBox version), Docker isn't running directly on your Windows OS. Instead, it's running inside a lightweight Linux virtual machine (VM) managed by VirtualBox.
  • The path shown in docker volume inspect my_vol is a file system path inside that Linux VM, not a path on your Windows host. That's why you can't locate it in Windows File Explorer—it doesn't exist there!

How to access your volume's content

You have two main options to interact with the files in your my_vol volume:

  1. Access the volume directly from the Linux VM

    • Open your Docker Quickstart Terminal (the one that launches with the whale icon).
    • Run this command to SSH into the default Docker VM:
      docker-machine ssh default
      
    • Once you're logged into the VM, you can navigate to the volume path and view its contents using standard Linux commands:
      ls /mnt/sda1/var/lib/docker/volumes/my_vol/_data
      
  2. Use a bind mount to link to a Windows directory (for direct local access)
    If you want the volume's files to be visible and editable directly on your Windows machine, swap the named volume for a bind mount when starting your container. For example:

    docker run -d -p 221:22 -v /c/your/windows/path:/opt/my_vol --name my_dock_r1 my_dock
    
    • Note: In Docker Toolbox, Windows paths need to be formatted using forward slashes (e.g., /c/Users/YourName/Desktop/my_volume_files) instead of backslashes.

Did you misunderstand Docker volumes?

Nope! Your setup is totally correct:

  • You defined a volume in your Dockerfile with VOLUME /opt/my_vol
  • You successfully mounted the named volume my_vol to that container path when running docker run
  • The volume is working as expected—you can see it in docker volume ls and access it inside the container. The only twist is the underlying VM storage, which is specific to the VirtualBox-based Docker setup.

内容的提问来源于stack exchange,提问作者TheLovelySausage

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:40:24