Settings to Windows Firewall to allow Docker for W

2020-01-30 00:35发布

Windows Firewall is blocking my attempt to allows Docker for Windows to share C: on windows 10 machine.

Works fine when Windows Firewall off. When its on I get

A firewall is blocking file Sharing between Windows and the containers. See documentation for more info.

The documentation says

You do not need to open port 445 on any other network. By default, allow connections to 10.0.75.1 port 445 (the Windows host) from 10.0.75.2 (the virtual machine).

I am "googled out" on trying to find how to do that - can someone advise?

30条回答
走好不送
2楼-- · 2020-01-30 01:02

In my case, I disabled "Block TCP 445" on Windows Defender Firewall with Advanced Security and it worked. Then enabled it again after setting shared drives on Docker.

setting of Block TCP 445

setting of Shared drives

查看更多
一纸荒年 Trace。
3楼-- · 2020-01-30 01:02

In short, use the Edge version.

The Edge version of Docker for Windows since 2.1.5.0 (2019-11-04) has a new implementation of file sharing without requiring firewall modifications https://docs.docker.com/docker-for-windows/edge-release-notes/

"New file sharing implementation: Docker Desktop introduces a new file sharing implementation which uses gRPC, FUSE, and Hypervisor sockets instead of Samba, CIFS, and Hyper-V networking. The new implementation offers improved I/O performance. Additionally, when using the new file system:

Users don’t have to expose the Samba port, and therefore do not experience issues related to IT firewall or the drive-sharing policy.
There is no need to provide user credentials to Docker Desktop. File access rights are automatically enforced when accessing mounted folders through containers.

"

You can download the edge version: https://download.docker.com/win/edge/Docker%20Desktop%20Installer.exe

Note as of now, the edge version of 2.1.7.0 will be used for next stable release: "Note: Docker Desktop Edge 2.1.7.0 is the release candidate for the upcoming major Stable release.". So the risk of using Edge is relatively low. Or you can wait for next stable release, to avoid all these firewall issues.

查看更多
虎瘦雄心在
4楼-- · 2020-01-30 01:04

My C drive stopped being shared with Docker after a recent Windows 10 update. I was getting the same problem saying it was blocked by the Windows firewall when attempting to reshare it.

Looking through the above solutions, I found something that worked for me that is simpler than anything else I saw on this page. In Control Panel\All Control Panel Items\Network and Sharing Center, on the vEthernet (DockerNAT) connection, I unchecked the property File and Printer Sharing for Microsoft Networks and saved the setting. Then I checked the property again to reenable it and saved it again.

At this point, I was able to reshare the C drive in Docker settings. I have no idea why this worked but it was not a firewall problem, which already have an entry for DockerSmbMount.

查看更多
forever°为你锁心
5楼-- · 2020-01-30 01:04

I had the same problem and tried all the fixes - and it turned out that more than one was necessary:

  • Add a firewall rule (Norton Security for me)
  • Make the network private
  • Share the drive

I've written a full explanation at http://kajabity.com/2017/08/unblock-docker-for-windows-firewall-issues-with-host-volumes/

查看更多
欢心
6楼-- · 2020-01-30 01:06

None of the above worked for me.

What finally did the trick was opening the properties of the "vEthernet (DockerNAT)" network and ticking the box "Hyper-V Extensible Virtual Switch" at the bottom of the list under the "Networking" tab.

Not sure if this is the actual fix or whether it just somehow reset the network adapter for me... but it worked!

查看更多
混吃等死
7楼-- · 2020-01-30 01:07

My solution was to disconnect from the VPN; that was causing the issue

查看更多
登录 后发表回答