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

Hyperledger Fabric启动报错:无法创建peer0.org1.example.com容器

Fixing "Mount denied: Invalid Windows path" Error in Hyperledger Fabric's startFabric.sh on Windows 10 Pro

Hey there, I’ve run into this exact headache when setting up Hyperledger Fabric on Windows 10 Pro—let’s break down how to fix it. The error pops up because Docker on Windows struggles with the Linux-style path /var/run being mounted in the Fabric peer container, especially if you’re using the wrong terminal environment or haven’t tweaked Docker’s settings properly.

Here are the step-by-step fixes to try:

1. Run the script in a WSL 2 terminal (not PowerShell/CMD)

Hyperledger Fabric’s shell scripts are built for Linux environments. Running them directly in Windows’ native terminals (PowerShell/CMD) messes up path translation.

  • Open your preferred WSL 2 distribution (like Ubuntu) from the Start Menu
  • Navigate to your Fabric project directory within the WSL filesystem (e.g., cd ~/fabric-samples/composer)
  • Re-run ./startFabric.sh from here—this lets Linux-style paths work as intended.

2. Check Docker Desktop’s WSL Integration settings

Docker needs proper integration with your WSL 2 distro to handle mounts correctly:

  • Open Docker Desktop, go to Settings > Resources > WSL Integration
  • Make sure the toggle for your WSL 2 distro (e.g., Ubuntu) is switched on
  • Click Apply & Restart to save changes

3. Manually adjust the mount path in startFabric.sh (if needed)

If the above steps don’t resolve the issue, tweak the problematic mount line in the script:

  • Open startFabric.sh in a text editor (use nano startFabric.sh within WSL)
  • Find the section defining peer0.org1.example.com—you’ll see a line like:
    -v /var/run:/host/var/run/ \
    
  • Replace it with the WSL-compatible path:
    -v /run:/host/var/run/ \
    
  • Save the file and re-run the script.

4. Reset Docker’s File Sharing permissions

Sometimes Docker’s file sharing settings block valid mounts:

  • In Docker Desktop, go to Settings > Resources > File Sharing
  • Ensure the drive where your Fabric project is stored (usually C:) is checked
  • Click Apply & Restart to refresh permissions

After trying these steps, re-run ./startFabric.sh—the mount error should be gone, and your Fabric network should start up smoothly.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 06:21:10