for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Unable to share drive, complains firewall is blocking

Open tcederquist opened this issue 9 years ago • 47 comments

Expected behavior

Starting a container - mount a drive via -v.

Actual behavior

Was working this morning. Upgraded windows to build 1703 and it stopped working, issuing a docker restart and the container would not start with a share failure. Rebuilt the container after uninstalling/reinstalling and when starting - this is the exchange: docker run --name ermngxatest --dns 172.30.0.2 -d -p 8183:443 -v D:\editor:/usr/share/nginx/html ermngxa docker: Error response from daemon: D: drive is not shared. Please share it in Docker for Windows Settings.

Opened the docker window panel and turned off/on sharing for the drive and it says a firewall is blocking the port 445. I turned off the windows firewall (I don't have any other 3rd party firewalls) and it still says firewall blocking. I downgraded docker from edge v17 to production ce v17 and didn't fix the issue, same error message. Firewall detected A firewall is blocking file Sharing between Windows and the containers. See documentation for more info.

Information

  • Diagnostic ID from "Diagnose & Feedback" in the menu. A diagnostic was uploaded with id: AF795227-392B-4452-A072-A18C1763F27D/2017-05-11_16-12-42
  • host distribution and version (Windows version, build number, etc) Windows 10 build 1703

Steps to reproduce the behavior

  1. open the docker config window
  2. pick the share tab
  3. click a drive and click apply
  4. check out the error message

tcederquist avatar May 11 '17 20:05 tcederquist

This happens to me periodically, especially after a suspend. The workaround I found on this forum is to go into the Network and Sharing Center, and in any NIC go into Properties, Uninstall and Reinstall the "File and Printer Sharing for Microsoft Network" service. Most of the time, this will get drive sharing going again without having to restart Docker and/or resetting the mount credentials.

jasonterando avatar May 11 '17 21:05 jasonterando

@jasonterando that Fixed it!

Thank you for the quick feedback!

tcederquist avatar May 12 '17 04:05 tcederquist

I don't think you should close this ticket : to me, it seems to be a real issue :

  • The problem was not there 2 months ago. I had no pb to share a drive with Docker on Windows 10 before ...
  • If I restore the "File and Printer Sharing for Microsoft Network" service, it's OK until the next reboot or the next Windows Live update
  • I don't think that a valid "fix" implies to update some NIC properties manually. It's more a workaround than a fix ...

Regarding the timeline, I think the problem can be related to the "famous" security patch on SMBv1 from March 14th (see ms17-010 )

Could you please consider to reopen this ticket ?

(upd : found #355. Last comments are related)

manuito avatar May 17 '17 07:05 manuito

A fair comment @manuito and I was 50/50 on leaving open vs closing. I'll reopen and see what happens.

tcederquist avatar May 17 '17 14:05 tcederquist

What Docker for Windows version are you using? Recent releases (eg. 17.05) include a fix that checks for this.

friism avatar May 17 '17 14:05 friism

Mmm, I'm in 17.03.1-ce-win12, but when I check for updates, I have a message telling me that my Docker is up to date. Running on Win10 1703 - 15063.296. The stable docker installer at https://download.docker.com/win/stable/InstallDocker.msi doesn't seems to provide a different version neither.

  • Does this fix exists for CE, or on Enterprise Edition only ?
  • Maybe v17.05 is on Edge channel only ?

manuito avatar May 17 '17 14:05 manuito

Can you try the edge version? https://docs.docker.com/docker-for-windows/install/

friism avatar May 17 '17 14:05 friism

Test done with Edge, now running 17.05.0-ce-win11 (12053) = exact same pb => "A firewall is blocking file Sharing between Windows and the containers...". Need to "restart" file sharing in NIC properties after each restart for workaround ... :'(

manuito avatar May 17 '17 15:05 manuito

Assigning @simonferquel - he'll take a look.

friism avatar May 17 '17 16:05 friism

@manuito - do you, by chance, use a VPN or anything similar that might affect the network configuration on your machine?

jasonterando avatar May 19 '17 13:05 jasonterando

mmm, yep, I have a VPN client on this machine, you're right I should test without it. I will try from the begining on another win computer and let you know.

manuito avatar May 19 '17 13:05 manuito

I`m facing the same issue for a considerable time. I just full reinstall Windows in a new machine and using edge version of Docker and Windows full updated and i only can share drives if switch off and on printer and file share on Docker NAT NIC created by installation. As mentioned, the shares lives only until next reboot.

fcjbispo avatar May 23 '17 17:05 fcjbispo

I also have this exact issue since 2 weeks ago.

After reboot docker loses access to C, i have to:

  • reapply "File and Printer Sharing for Microsoft Network"
  • go to docker Settings/Shared Drives and press the apply button.

Version: 17.03.1-ce-win12 (12058) OS: Windows 10 Pro Edition: Professional Id: 1703 Build: 15063

welja avatar May 25 '17 06:05 welja

So, I don't know if this helps, but I had suspended my Windows 10 computer (fajitas and an IPA were waiting to be consumed). Docker was running two Linux containers. After consuming said fajitas and beverage, I resumed the computer. Mounts were inaccessible. I uninstalled and reinstalled the File and Printing Sharing service, and mounts worked. Note: I did not have to restart Docker, re-share drives, etc. Just reinstalling the File and Printing service did the trick.

Diagnostic log: C7ED5F5F-3273-4BDE-9A44-A018CA0CBD67/2017-05-25_19-41-00

jasonterando avatar May 26 '17 00:05 jasonterando

Try Power Shell 3 command under Adminstator access rights as follows:

Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private

Then enable drive C,D share in Docker settings.

default-writer avatar May 28 '17 10:05 default-writer

@welja workaround works for me also.

Diagnostic Log: AEBA5F32-8C54-4C62-AE3C-1F1875F0F239/2017-05-29_18-38-47

Svobi avatar May 29 '17 16:05 Svobi

@hack2root Thanks for your tip, ~~but sadly it does not fix the situation much. ~~ After a reboot i have to reapply your command line (or do the "File and Printer Sharing for Microsoft Network" thing ), and the docker sharing thing has to be redone aswell. But i could make it into a little script (when this starts to annoy me more :) )~~

It does not seem to work now, i still get a 'Firewall is blocking' message from docker wen trying to apply sharing after using: Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT) 2" -NetworkCategory Private (yes, my adapter has 2 added to its name) I thought it worked a few days ago, but maybe i allready did the "File and Printer Sharing for Microsoft Network" thing.

welja avatar Jun 03 '17 22:06 welja

Some improvement over there : With update 17.06.0-rc1-ce-win13 (12433), now it seems to be OK, even after a reboot. I do not need anymore to restart NIC properties for file sharing.

After a look to the release note (https://docs.docker.com/docker-for-windows/release-notes/#docker-community-edition-17060-win13-release-notes-2017-06-01-17060-rc1-ce-win13-edge), there is "New => Sharing a drive can be done on demand, the first time a mount is requested". I suppose it provides a new way to request a Windows shared drive from Docker core, which fix our problem here.

As it is fixed on EDGE version only (17.06 beta), you may have to wait a while for an update on STABLE version (currently in 17.03)

manuito avatar Jun 07 '17 07:06 manuito

Just want to echo @manuito I also had this issue and it went away after upgrading to edge version 17.06.0-rc2-ce-win14 (12510).

galtrold avatar Jun 08 '17 18:06 galtrold

I'm on Version 17.06.0-ce-win17 (12626) and I have the problem... Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private fixes it (at least for now)

The fix does'nt survive a restart

Rambrant avatar Jul 13 '17 08:07 Rambrant