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

'Drive sharing failed for an unknown reason #3174

Closed
2 tasks done
astannard opened this issue Jan 3, 2019 · 20 comments
Closed
2 tasks done

'Drive sharing failed for an unknown reason #3174

astannard opened this issue Jan 3, 2019 · 20 comments

Comments

@astannard
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:B5EDDF18-C4CF-4711-B79E-9351539163DC/20190103093944

Expected behavior

I use docker-compose to bring up a docker image, windows prompts me to share the drive, I enter username and password and docker-compose completes.

Actual behavior

Once I enter password to share the drive I see the following error appear in the command window:
ERROR: for server_uikitrails_1 Cannot create container for service uikitrails: b'Drive sharing failed for an unknown reason'

ERROR: for uikitrails Cannot create container for service uikitrails: b'Drive sharing failed for an unknown reason'
ERROR: Encountered errors while bringing up the project.

Information

Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:51 2018
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false

Steps to reproduce the behavior

run docker-compose up on a ruby based docker image.
within docker settings trying to share a drive (c:) tick the drive and apply. It asks for password, and then the drive becomes unticked but no error or explanation given

@skumar568
Copy link

Hi,

I am also facing similar error. I am not getting above error but Docker just freezes when I share any drive with docker. I am using Windows 10 Pro 64bit. Below is the docker version detail that I am using:-
C:\Users\Sanjeev.Kumar51>docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:51 2018
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false

Regards,
Sanjeev

@astannard
Copy link
Author

Hi, an update for anyone who might come across this, and needs help as they sit at their computer crying into their latte.

The issue was the user account I was using to grant share access, I was using a domain user. I had to create a local user on my computer to share the drive access, then it all worked as expected. Please see the following article for help in the matter: http://peterjohnlightfoot.com/docker-for-windows-on-hyper-v-fix-the-host-volume-sharing-issue/ p.s. the websites a little slow

@skumar568
Copy link

Hi Astannard,

I tried steps proposed by you, but still not able to share the drives between Win10 and Docker containers with Hyper-V. Could you please help me with this?

Regards,
Sanjeev

@astannard
Copy link
Author

Sanjeev, I would check your computers event logs for a related error message. I did not find one for me though but my docker instance did not crash, it just did not share the drive with no failure message or explanation.

The other thing to try if you see no error message in the logs would be to try sharing the drive from a command window, you might see an error pop up then??

@Dill7736
Copy link

@astannard I am also facing the same issue. Please see the details below:

Steps Tried:

  1. Docker gives me error saying Windows Firewall is blocking the File sharing
  2. When i start docker as admin user it says Drive Sharing failed for an unknown reason
  3. Tried to run this command from Powershell docker run --rm -v c:/Users:/data alpine ls /data
    but it gives me same error.

Any work around for this issue? I am using Docker Stable version.

@inthrakumarp
Copy link

image

I checked the shared checkbox for my C: drive and ran the command it worked for me.

@kglogins
Copy link

kglogins commented Jun 4, 2019

Hi, everybody!

I was facing the same issue when starting containers with docker-compose I got the error:

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

Then I checked settings for Docker and under Shared Drives section I tried to check the checkbox for C: drive as @inthrakumarp did, but after hitting apply checkbox unchecked itself.

Then I copied the line docker run --rm -v c:/Users:/data alpine ls /data into Powershell, ran it and got the error:

Drive sharing failed for an unknown reason.

But after this error, I decided to just try restarting Docker. After the restart, I tried to check the checkbox in the Shared Drives section once again and now it stayed checked and everything is working as it should.

I was using Docker Stable version.

@ascott18
Copy link

@astannard Hey, might want to edit that link to peterjohnlightfoot.com out of your post - looks like the domain is parked now and is just redirecting to malware sites.

@7orG
Copy link

7orG commented Jun 14, 2019

it worked for me to restore to factory default

@DimosthenisK
Copy link

Hi, an update for anyone who might come across this, and needs help as they sit at their computer crying into their latte.

The issue was the user account I was using to grant share access, I was using a domain user. I had to create a local user on my computer to share the drive access, then it all worked as expected. Please see the following article for help in the matter: http://peterjohnlightfoot.com/docker-for-windows-on-hyper-v-fix-the-host-volume-sharing-issue/ p.s. the websites a little slow

This helped me immensely. Keep in mind that you must have an activated copy of windows to create the user account.

Also, you can't have your data in the domain user folder, as you will get a permission denied error. It must be somewhere public.

@darkfateinc
Copy link

image

I checked the shared checkbox for my C: drive and ran the command it worked for me.

it worked for me too. Thanks!

@marsjaninzmarsa
Copy link

@astannard Hey, might want to edit that link to peterjohnlightfoot.com out of your post - looks like the domain is parked now and is just redirecting to malware sites.

Web Archive for the rescue: http://web.archive.org/web/20181231025453/http://peterjohnlightfoot.com/docker-for-windows-on-hyper-v-fix-the-host-volume-sharing-issue/

@brij300
Copy link

brij300 commented Nov 8, 2019

I just found one more solution which worked me. On powershell just run below command:

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

@toxmc
Copy link

toxmc commented Nov 11, 2019

image
image
image
image

It's very very slow.

@jamesbluecrow
Copy link

A simple docker restart worked for me 👍

@latuszek
Copy link

it worked for me to restore to factory default

I've tried many things but this one helped at last.

@almothafar
Copy link

almothafar commented Feb 2, 2020

Here is the way that driving share worked for me:

  1. First of all, I'm Under AzureAD, so I have to create a new local admin user.
  2. I logged in that user to make sure he got activated correctly, then logged out to my original user.
  3. Did Factory Reset and tried to share my drive, asked me to input username and password, used the newly created account, but it keeps asking me for username and password.
  4. I clicked cancel and did the Reset factory again.
  5. Click share drive, worked without any question.

Does it make any sense? not at all, but it worked, how and why? I have no idea, but it is working now so who cares! 😄

@fazefatim
Copy link

Hello ,if anyone still facing the same isssue.I ve resolve it by running my GIT CMD as an administrator and in the final step u should allow Docker to create the container.Hope it can help u out it did for me

@AnthonyPortillaCano
Copy link

AnthonyPortillaCano commented May 12, 2020

You must change to 8.8.8.8 and then you are going to click the drive C:

AyudaShared
AyudaShared2

@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 4, 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