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

Volume mounts do not work on windows 10 #77

Closed
billhab opened this Issue Sep 13, 2016 · 52 comments

Comments

Projects
None yet
@billhab

billhab commented Sep 13, 2016

Expected behavior

docker run -it -v //c/Users://c/users Ubuntu bash
ls -al /c/users should show windows usernames

Actual behavior

Volume is created but /c/users is empty

Information

I have read all the issues where this has been reported before. Nothing I have tried makes any difference. It doesn't work. Even though volume is created in the container, it does not show any directories and files from the source path. Neither Issue #25 or Issue #50 solve this problem.

  1. Have disabled the firewall.
  2. Shared c in docker settings. have reset and supplied credentials.
  3. Have tried all variations of command syntax for volume parameter
  4. No help from freenode docker channel.
  5. Java client api using mounts works fine if Linux -> Linux. Same code fails with windows.
  6. When I inspect container it contains the proper source location.
  7. Fails the same whether run under powershell or cmd.
    • Diagnostic ID from "Diagnose & Feedback" in the menu.
    • a reproducible case if this is a bug, Dockerfiles FTW
    • page URL if this is a docs issue or the name of a man page
    • host distribution and version (Windows version, build number, etc)

A86A3BDC-3635-4682-A3B1-467D8ABE2260/2016-09-13_09-56-40

Steps to reproduce the behavior

  1. ... docker run -it -v //c/Users:/users Ubuntu bash
  2. ...ls -al /users
    Volume is mounted but nothing in the directory.
@billhab

This comment has been minimized.

billhab commented Sep 13, 2016

snap1

@MadLittleMods

This comment has been minimized.

MadLittleMods commented Sep 14, 2016

@billhab I think you are experiencing Hyper-V driver not supporting mounting volumes, see moby/moby#22981

I don't think the hyper-v driver does host (win) to guest (boot2docker) filesharing, so volume-mounting from the host windows 10 filesystem is not expected to work.

moby/moby#22981 (comment)

Ah! Yes, the Hyper-V machines don't have this as an option, only VirtualBox (and Docker for Windows)

moby/moby#22981 (comment)

You might be interested in this comment:

We have this problem with the docker beta on Windows. -v //Users/project://project doesn't work. There is no error message but nothing is mounted under /project inside the container. But we can do docker create -v //Users/project://project --name project-volume and then docker run --volumes-from project-volume

moby/moby#21909 (comment)

@billhab

This comment has been minimized.

billhab commented Sep 14, 2016

I think this is going in the direction that I will not be able to mount volumes successfully in a Windows environment. What good is docker if I can't access my data? I have read so many comments the past couple days that make my head spin. Do this: turn off your firewall or change firewall rules, play with domain user name, remove passwords with funny characters, reset credentials/restart Docker. Is there ANYTHING which works here? Would going to virtual box solve the problem? Maybe not because some people report that doesn't work either. Excuse me but I'm really frustrated with this scenario and no reliable answers.

@friism

This comment has been minimized.

friism commented Sep 14, 2016

@MadLittleMods that's not the case - Docker for Windows supports volume mounting.

@billhab can you try the test command suggested in the app?

docker run --rm -v c:/Users:/data alpine ls /data
@billhab

This comment has been minimized.

billhab commented Sep 14, 2016

@MadLittleMods - If you look at the screen shot which is the above you'll see I have done that. In fact I have done it about a hundred times when trying different combinations of suggestions from various people. It simply doesn't work. Now I heard that using hyper-v with Docker which is my setup does not support mounting volumes.
Is my only recourse to uninstall docker and reinstall with virtualbox???

@MadLittleMods

This comment has been minimized.

MadLittleMods commented Sep 14, 2016

@friism What are the intricacies/caveats of it? Here is a quote I found from you:

I don't think volumes are expected to work with the hyper-v driver. You should use the (default) virtualbox driver.

moby/moby#21909 (comment)


Trying not to butt into this issue but here is an example of volume mounting not working:

// Trying any of these combos
SET WORKSPACE=.
for /f "delims=" %a in ('pwd') do @set WORKSPACE=%a
for /f "delims=" %a in ('cd') do @set WORKSPACE=%a

docker-compose.yml

mongosetup:
  image: mongo:3.2
  volumes:
   - ${WORKSPACE}:/src
  working_dir: /src
  entrypoint: [ "/src/mongo-setup.sh" ]

But the entrypoint can't be found

> docker-compose up -d --no-recreate
ERROR: for mongosetup  Cannot start service mongosetup: oci runtime error: exec: "/src/mongo-setup.sh": stat /src/mongo-setup.sh: no such file or directory
> docker inspect mongosetup_1
...
"Mounts": [
            {
                "Source": "/c/Users/MLM/Documents/GitHub/something",
                "Destination": "/src",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
...
@friism

This comment has been minimized.

friism commented Sep 14, 2016

@MadLittleMods that comment was talking about something created with docker-machine create using the hyper-v driver. Volume mounting from host won't work with that.

This question is about Docker for Windows, which has host volume mounting support and is different than docker machine.

@billhab

This comment has been minimized.

billhab commented Sep 14, 2016

I'm sorry guys. this isn't helping me. I just want to have access to a windows set of files (about 40gb of data) in a directory tree from a docker container. Mounting the path as a volume doesn't work. I'd like to find out how to make it work. If there isn't a way to get it working then I'd like to know so I can move on to finding another solution.

@phinz

This comment has been minimized.

phinz commented Sep 14, 2016

i have the same issue. The example command has a empty result:

> docker run --rm -v c:/Users:/data alpine ls /data
>

Until i tried to mount a subfolder:

> docker run --rm -v c:/Users/phinz:/data alpine ls /data
>
> docker run --rm -v c:/Users:/data alpine ls /data
> phinz

That seems very strange, because there are still more user folders in the path "c:/Users".

> ls c:/Users
drwxr-xr-x 1 phinz 1049089   0 Jan  4  2016 ./
drwxr-xr-x 1 phinz 1049089   0 Sep  8 09:24 ../
lrwxrwxrwx 1 phinz 1049089  14 Okt 30  2015 All Users -> c:/ProgramData/
drwxr-xr-x 1 phinz 1049089   0 Jan  4  2016 Default/
lrwxrwxrwx 1 phinz 1049089  16 Okt 30  2015 Default User -> c:/Users/Default/
drwxr-xr-x 1 phinz 1049089   0 Sep 13 17:43 phinz/
drwxr-xr-x 1 phinz 1049089   0 Jan  4  2016 Public/
> docker version
Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 17:32:24 2016
 OS/Arch:      windows/amd64
 Experimental: true

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 17:32:24 2016
 OS/Arch:      linux/amd64
 Experimental: true

OS: Windows 10 Enterprise

UPDATE: Problem seems solved in new Beta Version 1.12.1-beta26, Build 7018

@marc1404

This comment has been minimized.

marc1404 commented Sep 14, 2016

Experiencing the same problems as @phinz
Windows 10 Pro, Version 1511
Docker for Windows, Version 1.12.0-stable, Build 5968

Update: Working in beta channel, Version 1.12.1-beta25, Build 6833

@billhab

This comment has been minimized.

billhab commented Sep 14, 2016

Not only do you not see the content of the volume but you can't write back into it. The source never sees what has been copied there. This may be related or a different issue.

PS C:\Users\bihaber> docker run -it -v //d/scratch:/scratch bills:1.2 bash
root@b73c99d9b2c5:/# ls scratch
root@b73c99d9b2c5:/# ls -al scratch
total 4
drwxr-xr-x 2 root root 40 Sep 13 21:27 .
drwxr-xr-x 210 root root 4096 Sep 14 13:42 ..
root@b73c99d9b2c5:/# cp /bin/runtests.sh /scratch/runtests.sh
root@b73c99d9b2c5:/# ls -al scratch
total 16
drwxr-xr-x 2 root root 60 Sep 14 13:43 .
drwxr-xr-x 210 root root 4096 Sep 14 13:42 ..
-rwxr-xr-x 1 root root 9143 Sep 14 13:43 runtests.sh
root@b73c99d9b2c5:/#

@dgageot

This comment has been minimized.

dgageot commented Sep 16, 2016

@billhab Have you tried version Beta26? Both @marc1404 and @phinz report that it fixes their issue

@billhab

This comment has been minimized.

billhab commented Sep 16, 2016

Is it newer than what I am running and if so how do I get it?
PS C:\Users\bihaber> docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: windows/amd64

Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64
PS C:\Users\bihaber>

@thasmo

This comment has been minimized.

thasmo commented Sep 16, 2016

@dgageot I'm running Docker for Windows version 1.12.1-beta26 and Docker doesn't mount the specified directory. Running docker run --rm -v c:/Users:/data alpine ls -al /data lists an empty directory, although I've enabled to share C: in the Docker UI settings.

@billhab

This comment has been minimized.

billhab commented Sep 16, 2016

I just tried Docker for Windows version 1.12.1.beta26 and it doesn't work either.
Can I get this to work if I use Docker Toolbox instead??

@billhab

This comment has been minimized.

billhab commented Sep 16, 2016

I have uninstalled Docker, then installed Docker toolbox. Neither work.
I reinstalled 1.12.0 stable then got notice of new stable version.
I installed stable version but installer told me it didn't have privileges to install new services.
I'm done playing games here.

@thasmo

This comment has been minimized.

thasmo commented Sep 16, 2016

So, after trying over a dozen tweaks, settings, changes and reboots it suddenly works but I'm not able to break it on purpose so I've no idea what did it. :(

@protubero

This comment has been minimized.

protubero commented Sep 19, 2016

I'm trying to Mount host volumes for some weeks now, without success. Log files tell me, that sharing works, but the Directory Content shown only lists previously mounted Folders and nothing else. I'm Kind of frustrated with this.

D9E7060A-B59A-4546-BAB8-3E537A4C22D6/2016-09-19_10-04-47

@josemanners

This comment has been minimized.

josemanners commented Sep 20, 2016

I followed the instructions in this article https://blogs.msdn.microsoft.com/stevelasker/2016/06/14/configuring-docker-for-windows-volumes/

and after a few tries the way I made it work was by giving Docker the local computer name as part of the credential (i.e. MYCOMPUTER\DockerHost )

@billhab

This comment has been minimized.

billhab commented Sep 20, 2016

josemanners - is your system windows 10 with hyper-v?

@dgageot

This comment has been minimized.

dgageot commented Sep 21, 2016

@billhab @thasmo @protubero @josemanners Stay tuned and thank your for being really patient. A better file sharing should ship in next beta!

@josemanners

This comment has been minimized.

josemanners commented Sep 21, 2016

@billhab to answer your question, I'm running Windows 10 Enterprise Build 14393.105

@moler

This comment has been minimized.

moler commented Sep 22, 2016

I had the similar issue with Docker 1.12.0-stable (Hyper-V) on Windows 10. I thing that the main problem was with my firewall which blocked Hyper-V Virtual Ethernet Adapter (DockerNAT). I did follow:

  1. Updated to new stable version 1.12.1
  2. Shared c in Docker settings and restarted Docker via Setting-Reset-Restart Docker
  3. Turned off antivirus software including firewall
  4. Restarted Docker via Setting-Reset-Restart Docker

You can try it.

@billhab

This comment has been minimized.

billhab commented Sep 22, 2016

@moler All that was tried. Didn't work. I have McAfee firewall. Turning it off didn't help.

@billhab

This comment has been minimized.

billhab commented Sep 22, 2016

@dgageot What makes you believe that the next beta will fix this issue?

@dgageot

This comment has been minimized.

dgageot commented Sep 28, 2016

@billhab Beta27 was released today with hardened file sharing feature. Could you take a look and close this issue if it is fixed? Thanks a lot!

@billhab

This comment has been minimized.

billhab commented Oct 8, 2016

It works only if I am not connected to my VPN and the firewall is turned off.

@dgageot

This comment has been minimized.

dgageot commented Oct 18, 2016

@billhab @protubero Thanks a lot for your feedback. I'm going to close this issue as a duplicate of #114

@richarddowner

This comment has been minimized.

richarddowner commented May 27, 2017

Encountered this issue today, May 2017
docker for windows version 17.03.1-ce-win12 (12058)
Resolved it by unsharing C drive then resharing.
Hopefully that helps someone

@dharmeshkakadia

This comment has been minimized.

dharmeshkakadia commented May 30, 2017

+1

@vladyslavmunin

This comment has been minimized.

vladyslavmunin commented Jun 6, 2017

I also encountered this issue,
resolved it with setting in HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
EnableAuthenticateUserSharing to 1
maybe it can helps someone

@enlyn

This comment has been minimized.

enlyn commented Jun 12, 2017

+1

@jasonbivins

This comment has been minimized.

jasonbivins commented Jun 12, 2017

Hi @vladyslavmunin I'll capture that and turn it into a KB article, thanks!

@WizX20

This comment has been minimized.

WizX20 commented Jun 30, 2017

Does not work on 17.06.0-ce-win18 (12627) windows 10. Tried re-sharing drives, and editing the reg-key. When I change a volume to D:\My-Path, and enable volume sharing, it will always map to the default location. Then the container will fail to boot: Operation not permitted, terminating.

@zbennett10

This comment has been minimized.

zbennett10 commented Aug 8, 2017

Just wanted to chime in to say @richarddowner solution worked for me

@SuhanKoh SuhanKoh referenced this issue Nov 2, 2017

Merged

Dockerize FredBoat + Postgres + ditch sqlite #382

5 of 5 tasks complete
@akhchan

This comment has been minimized.

akhchan commented Feb 28, 2018

Works great with richarddowner's solutiion. Thanks.

@Puetz

This comment has been minimized.

Puetz commented May 15, 2018

I just wanted to mount a local folder to my container and used the exact same commands that worked multiple times in the past

docker run -d --name core --mount type=bind,source="C:\Users\...\myapp",target=/app python
docker run -d --name core -v C:/Users/.../myapp:/app python

but non of them worked.
I also used
docker commit <container_id> my-broken-container && docker run -it my-broken-container /bin/bash
in order to take a look into the app folder and it was empty.

I reset my credentials, changed my password and even reinstalled Docker but it's still not working. Does anybody have an idea how I can fix this?
Thanks.

@sharkvan

This comment has been minimized.

sharkvan commented Jul 12, 2018

Just and FYI,

I was running into this issue where the folder mounting was not working. I was trying to run docker via the terminal Cmder. Cmder was doing something that was making the mount operation fail. So if you're reading this and using Cmder, switch to powershell on Windows.

On a side note, I was docker a lot on linux, I can't believe how slow it is on Windows, PAINFUL.

@liesislukas

This comment has been minimized.

liesislukas commented Aug 12, 2018

I think it was related to password change on windows user. I used @richarddowner solution to fix.

@Noext

This comment has been minimized.

Noext commented Sep 5, 2018

@liesislukas is right, i have change my windows password and disk sharing was **** up after that, need to unshare and share all driver after that

@paulfitz paulfitz referenced this issue Oct 6, 2018

Closed

error building #27

@navarq

This comment has been minimized.

navarq commented Nov 5, 2018

Resetting credentials via the tray icon, in settings, shared drive

Then specifying the full location of the directory to be mounted solved the issue for me.

@LeonardAB

This comment has been minimized.

LeonardAB commented Dec 4, 2018

experienced same condition as @liesislukas and @Noext , I have to change password regularly and did not realize that it affected the docker drive sharing credential. @richarddowner solution worked like a charm. Thanks a lot!!!

It might be good if when the mounting fails, docker can give an error message.

@higkoo

This comment has been minimized.

higkoo commented Dec 5, 2018

#77 (comment)

error is still exist.

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

[16:13:26.271][SambaShare ][Error ] Unable to mount C drive: 10.22.33.1 (10.22.33.1:445) open
rm: cannot remove '/c': No such file or directory
rm: cannot remove '/C': No such file or directory
umount: /host_mnt/c: not mounted.
mount.cifs kernel mount options:
ip=10.22.33.1,unc=\10.22.33.1\C,noperm,iocharset=utf8,dir_mode=0777,nobrl,mfsymlinks,vers=3.02,sec=ntlmsspi,user=higkoo,domain=BILIOPS,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment