Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: A firewall is blocking file sharing between Windows and the containers #2677

Closed
2 tasks done
janne-j opened this issue Oct 2, 2018 · 32 comments
Closed
2 tasks done

Comments

@janne-j
Copy link

janne-j commented Oct 2, 2018

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 52ED87FF-A339-471A-B711-E6A2B4CDE7D2/20181002090201

Expected behavior

Share drives on Windows 10 should succeed

Actual behavior

Error: A firewall is blocking file sharing between Windows and the containers

Information

I've tried the following workarounds / steps but the problem persists:
https://success.docker.com/article/error-a-firewall-is-blocking-file-sharing-between-windows-and-the-containers
http://stackoverflow.com/questions/42203488/settings-to-windows-firewall-to-allow-docker-for-windows-to-share-drive/43904051#43904051
http://blog.medhat.ca/2017/01/docker-on-windows-10-error-firewall-is.html
http://www.kajabity.com/2017/08/unblock-docker-for-windows-firewall-issues-with-host-volumes/

Seems to be ongoing issue, here's a few more duplicate issues
Error: A firewall is blocking file sharing between Windows and the containers #2512
Upgraded and Can't share drive with docker I get: Error: A firewall is blocking file Sharing between Windows and the containers #2527
Windows 10: Docker for Windows: unable to share drive #2549
Windows 10: Docker for Windows: unable to share drive #690
Cannot Share drives Windows10 #1801
Unable to share drives #803
Windows 10 - Firewall Share C:\ Drive Blocking Problem - Many Proposed Solution Attempted #2628
Drive sharing seems to be blocked by a firewall #2629
New install of Windows 10 and Docker, unable to share drive false firewall error #2369
Error: A firewall is blocking file Sharing between Windows and the containers #355
firewall is blocking file sharing between windows and the containers #2159
Unable to share drive, complains firewall is blocking #738
Sharing drive fails with "Firewall detected" dialog box #345
Unable to share C: Drive [firewall] #466
Share Drive #2198

  • Windows Version:
    Windows 10 Enterprise Version 1709 build 16299.665
  • Docker for Windows Version:
    Version 2.0.0.0-beta1-win75 (19925)
    Channel: edge

Steps to reproduce the behavior

  1. Launch Docker
  2. When Docker is running, from 'Shared Drives' select C and click Apply
@samiulanik
Copy link

samiulanik commented Oct 6, 2018

I am also having exact same issue. Tried lots of thing, nothing works.
Diagnostic Id: FCDAC24B-473C-41BA-9F97-7450EB28CD38/20181006124621
Windows Version:
Windows 10 Pro Version 1803 build 17134.285
Docker Windows Version:
Version 18.06.1-ce-win73 (19507)
Channel: stable

@Ultronvision
Copy link

I have also same issue firewall blocking, searching a lot but found nothing, I am using Docker version 18.06.1-ce, build e68fc7a at Window 10 pro.

@janne-j
Copy link
Author

janne-j commented Oct 23, 2018

Update:

Our IT support created a new group policy for F-Secure that allows me to turn firewall off. After disabling firewall sharing drives on Docker works alright but firewall needs to be disabled whenever trying to mount anything to a container.

@ThinhTT84
Copy link

I have windows 10 1803, Firewall is off (both Windows Defender & McAfee Endpoint Security) but still cannot share the driver. I tried to uninstall File and Print sharing service on the Hyper-V virtual network card as suggestion in document but cannot do it.

@janne-j
Copy link
Author

janne-j commented Oct 30, 2018

I have windows 10 1803, Firewall is off (both Windows Defender & McAfee Endpoint Security) but still cannot share the driver. I tried to uninstall File and Print sharing service on the Hyper-V virtual network card as suggestion in document but cannot do it.

  1. First turn off Docker (wait until completely closed)
  2. Disable Firewall
  3. Turn on Docker
  4. Share drive

@ThinhTT84
Copy link

First turn off Docker (wait until completely closed)
Disable Firewall

I have firewall completely off from beginning already :(.

@p-obrien
Copy link

I'm having this issue because the VM is trying to use SMB v1 to connect to the C: Share but our enterprise has disabled SMB v1 due to age and security issues.

You can verify if this is the issue by checking the following registry key: HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and seeing if the key SMB1 is set to 0 or not.

Whilst enabling SMB v1 can resolve the issue its been disabled by default in Windows 10 for good reason and a more permanent fix is needed.

@ThinhTT84
Copy link

You can verify if this is the issue by checking the following registry key: HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and seeing if the key SMB1 is set to 0 or not.

This key is not available on my machine, I tried to add and set it value to 1, restart computer and tried share again but still no luck

@p-obrien
Copy link

Do you have the SMB components installed, Windows 10 doesn't have these installed by default?

You can check with this powershell:
Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol

If you choose to install SMB v1 you could use this command (however I don't recommend it):
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

In my environment I have the feature installed however group policy disables SMB v1 which prevents the file sharing from working.

@p-obrien
Copy link

Interesting, I followed these instructions and it worked for me #313 (comment)

@janne-j
Copy link
Author

janne-j commented Oct 31, 2018

Interesting, I followed these instructions and it worked for me #313 (comment)

Sharing is possible with local admin rights but after applying changes it won't persist and volume remains unshared.

@janne-j
Copy link
Author

janne-j commented Oct 31, 2018

Whilst enabling SMB v1 can resolve the issue its been disabled by default in Windows 10 for good reason and a more permanent fix is needed.

SMB1 seems to be already enabled on my machine. No luck with this workaround.

@p-obrien
Copy link

Confirming #313 (comment) works for me after a reboot and with SMB v1 disabled.

@tonyhxh
Copy link

tonyhxh commented Nov 10, 2018

Also tried following from #313, no luck.

Navigate to C:\Users\Public\Documents\Hyper-V (it will ask administrative permission)
Click on folder "Virtual hard disks"
Here you will find "MobyLinuxVM.vhdx", just right click on it and goto context menu "Share with -> Advanced sharing settings..."
There you just go ahead and enable sharing under Public folder sharing blade and that's it.

Upload diagnostic: 1F80BF17-0910-406C-87B0-0B4571194B20/20181110001015

@janne-j
Copy link
Author

janne-j commented Dec 20, 2018

In our case solution was to create a policy for F-Secure that allows filesharing from networks 192.168.65.0/24, 10.0.75.0/24 and 127.0.0.1

I'll have to dig into if those IP's are out-the-box or specific to my current network configuration. In other words, we'll test the same policy from an another developer's workstation.

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@RobinHSanner
Copy link

I am having the same issues. I have tried all the workaround with no luck including turning off my firewall

/remove-lifecycle stale

@alphabytes
Copy link

facing the same issue... tried all the suggested solutions above, none of them worked.

@RobinHSanner
Copy link

A fellow worker clued me in on how to fix it. Create a local account (note that this isn't a domain account with local administrators access) with membership in the groups 'Administrators' (the local one) and 'docker-users'. Then when Docker prompts for credentials enter the credentials of your local administrator account. I use Norton Smart Firewall and to get to the point where it would prompt me for credentials I still had to do the firewall exception thing.

@oscar6echo
Copy link

Same here.
I'm not able to create a local account as it is a corporate machine.
In this context, it seems there is no way to share local drives...

@rdagumampan
Copy link

We had similar issue and this blocking us from exploring SQL Server on containers for dev machines. Our devs runs on windows with Docker CE. The issue seems to have been existing for years with no clear resolution.

@LisaBurleson
Copy link

I've tried all the solutions proposed and still no joy. Docker works fine on my home computer, but it won't work on my work laptop (which has the firewall turned off). I have admin rights. I've uninstalled and re-installed a couple times just to be sure. I guess I just can't use it on this machine. Or I just copy all the files into the docker image and don't mount a local drive.

@djbios
Copy link

djbios commented May 22, 2019

Not working on my home PC. Interesting noticed: when I trying to share my C drive manualy (in explorer), after that, I see it in \\10.0.75.1\c , but when I try to check C drive in docker gui for sharing, it shows me "A firewall is blocking file sharing between Windows and the containers", and disable my manually created share. I've tried all solutions proposed here, still nothing.

@var23rav
Copy link

For Cisco Any-Connect(vpn) client try this solution

@coltenkrauter
Copy link

Open powershell as admin and run this,

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

@LisaBurleson
Copy link

I just tried that solution and it didn't change the firewall message. I tried messing with the .docker folder permission per #3385 and that didn't work either. The search continues...
Thanks for the suggestion.

@Amro-Hassan
Copy link

@coltenkrauter solution worked for me.

@abmptit
Copy link

abmptit commented Oct 31, 2019

I tried all workaround, any new clues plz?

@ndywicki
Copy link

Same issue, I've already tests all sugestions.

I can telnet my SMB service on 445, but I can't change the network caterory (NLM Policies group):

PS C:\WINDOWS\system32> Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
Set-NetConnectionProfile : Unable to set the NetworkCategory due to one of the following possible reasons: not running
PowerShell elevated; the NetworkCategory cannot be changed from 'DomainAuthenticated'; user initiated changes to
NetworkCategory are being prevented due to the Group Policy setting 'Network List Manager Policies'.
Au caractère Ligne:1 : 1
+ Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -Net ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (MSFT_NetConnect...9B5E1E4E54DE}"):root/StandardCi...nnectionProfile)
   [Set-NetConnectionProfile], CimException
    + FullyQualifiedErrorId : MI RESULT 2,Set-NetConnectionProfile

So, I found how I can mount manually a CIFS volume V3 version like:

docker volume create --driver local --opt type=cifs --opt device=//X.X.X.X/C/workspaces/myVolume --opt o=user=XXXX,domain=XX,password=XXXX,vers=3.02 --name myVolume

And use it, ex. in docker-compose:

services:
   ...
   volumes:
      - myVolume:/PATH_INSIDE_CONTAINER

volumes:
   myVolume:
      # this will use the volume created beforehand
      external: true

But is very painful...

@stephen-turner
Copy link
Contributor

This is fixed with the new filesharing implementation in 2.2.0.3, so closing this ticket.

@ndywicki
Copy link

I've update my windows docker client.... And it's work !!!!!
Thank you very much 😍

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests