Solve Docker for Windows error: A firewall is blocking file Sharing between Windows and the containers

For the quick answer jump to the conclusion.

Yesterday I was trying to mount a data volume in a Docker container and using Docker Community Edition for Windows (aka Docker CE for Windows) you first need to share your drives in the Docker settings:

ShareDrives

Unfortunately after clicking on “Apply” I got the following error:

A firewall is blocking file Sharing between Windows and the containers.

In the documentation link the explanation was quite clear, I needed to  allow connections to 10.0.75.1 port 445 (the Windows host) from 10.0.75.2 (the virtual machine).

Looking in my Windows firewall rules I saw the rule was already there:

Strange!

Then I tried to completely disable the Windows Firewall, but the result was still the same error. It didn’t helped.

After some reboots, Docker resets etc… and more than one hour troubleshooting I was finally able to find this blog post which helped me to solve the issue, which I will describe here:

  1. Go to the Network and Sharing Center:
  2. Win Button + X
  3. Click on “Network Connection”
  4.  A Settings window will be opened and scroll down in the Settings window
  5. Click on “Network and Sharing Center”:

  6. Click on the “VEthernet (DockerNAT)” adpater:

  7. Click on “Properties”:

  8. Uninstall “File and Printer Sharing for Microsoft Networks”:

  9. Install “File and Printer Sharing for Microsoft Networks” again:

  10. Click Close, and now you should be able to Share your drives in the Docker Settings and mount those drives and folders as a data volume like:
    docker run -d -P --name web -v C:temp:/webapp training/webapp python app.py

Conclusion

If you are getting the error and your firewall rules are OK, to solve this problem just uninstall and reinstall again the “File and Printer Sharing for Microsoft Networks” on the DockerNAT network interface.

21 thoughts on “Solve Docker for Windows error: A firewall is blocking file Sharing between Windows and the containers

  1. I had the same problem. You don’t even need to uninstall and reinstall the ‘File and printer sharing for microsoft networks’. Just uncheck it, save by clicking ‘OK’, then open VEthernet (DockerNAT) – properties again and check it again. Worked for me!

    Like

  2. I had the same problem. You don’t even need to uninstall and reinstall the ‘File and printer sharing for microsoft networks’. Just uncheck it, save by clicking ‘OK’, then open VEthernet (DockerNAT) – properties again and check it again. Worked for me!

    Like

  3. Hi! Thanks for your post! I tried with your guide, deactivated the firewall and even reinstalled Docker taking the latest edge version 17.11.0-ce-win40 but nothing helped.. Do you have any other idea? Thanks a lot in advance!

    Like

  4. Hi! Thanks for your post! I tried with your guide, deactivated the firewall and even reinstalled Docker taking the latest edge version 17.11.0-ce-win40 but nothing helped.. Do you have any other idea? Thanks a lot in advance!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.