moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.76k stars 18.67k forks source link

windows 10 docker volume mounting problems #23992

Closed daaps closed 3 years ago

daaps commented 8 years ago

Hello,

I am using Docker version 1.12.0-rc2, build 906eacd, experimental

The problem that i had with docker toolbox, regarding the fact that i cannot create volumes between windows and docker still persists:

an example : docker run -itd --name=nodejs --privileged=true -v c:\Users\xxx:/mnt/shared/ readytalk/nodejs does not map my folder inside docker. I tried many other combinations like :

-v c:/Users/xxx/:/mnt/shared/ , -v /c/Users/xxx/:/mnt/shared/, -v //c/Users/xxx/:/mnt/shared/ I am using PowerShell

dgageot commented 8 years ago

Hi @daaps, have you shared the C drive in your settings?

dgageot commented 8 years ago

capture

daaps commented 8 years ago

Hello,

Here is a screenshot :

image

After i enabled the shared drive, when i do ls -l on my directory i see 0 content.

dgageot commented 8 years ago

@daaps Have you tried to reset to factory defaults and then re-enable file sharing? Beware that this will wipe out all your containers and images

zer0beat commented 8 years ago

I have the samme issue. If I look into MobyLinuxVM I can't see the contents of my HDDs..

image

I tried to reset factory, re-enable the file sharing and reset credentials. But the problem still here.

I'm using Docker 1.12.0-rc2-beta17 (build: 5022).

greut commented 8 years ago

Reset to factory defaults... did it for me. (1.12.0-rc3-beta18 build 10586)

daaps commented 8 years ago

Installed docker 1.12.0.rc3. I have the same problem :

image

I have my drives shared :

image

reseted to factory default, still the same problem.

It may a problem because i have cygwin installed on my computer? It could be a conflict?

aharpervc commented 8 years ago

Possibly a duplicate of https://github.com/docker/docker/issues/22981

caylorme commented 8 years ago

I have this same problem running 1.12.0-rc3 build 91e29e8

Cannot seem to get a volume mount to work properly. Also, only my C drive shows up, cannot get network mounts to show up under "Shared Drives"

KekSfabrik commented 8 years ago

So I'm having an issue which might be related - Occured on 1.12.0-rc4-beta18 and on 1.12.0-rc4-beta19 on win10 pro with non-admin users (tested on multiple machines, some upgraded from win8.1 and some fresh win10 installs): Trying to share fails most of the time and shares seem to disappear after reboot of the pc (have to check and then rm all containers - see lower down in the description): Daemon Logoutput:

...
[09:39:26.097][NamedPipeServer][Info   ] Start done.
[09:39:26.102][NamedPipeClient][Info   ] Received response for Start
[09:39:26.123][NamedPipeClient][Info   ] Sending IsShared(C, MYUSER:**********)...
[09:39:26.128][NamedPipeServer][Info   ] IsShared(C, MYUSER:**********)
[09:39:26.149][Cmd            ][Info   ] Diese freigegebene Ressource existiert nicht.
[09:39:26.155][Cmd            ][Info   ] 
[09:39:26.160][Cmd            ][Info   ] Sie erhalten weitere Hilfe, wenn Sie NET HELPMSG 2310 eingeben.
[09:39:26.165][Cmd            ][Info   ] 
[09:39:26.171][SambaShare     ][Info   ] "C" is not shared
[09:39:26.176][NamedPipeServer][Info   ] IsShared done.
[09:39:26.181][NamedPipeClient][Info   ] Received response for IsShared
[09:39:26.192][NamedPipeClient][Info   ] Sending Unmount(C)...
[09:39:26.198][NamedPipeServer][Info   ] Unmount(C)
[09:39:26.204][HyperV         ][Info   ] Unmount /C;/c
[09:39:26.213][PowerShell     ][Info   ] Run script with parameters: -Unmount True -UnmountPoints /C;/c...
[09:39:26.627][HyperV         ][Info   ] Un-Mount volume /C;/c
[09:39:26.667][NamedPipeClient][Info   ] Received response for Unmount
[09:39:26.661][NamedPipeServer][Info   ] Unmount done.
[09:39:26.675][Notifications  ][Info   ] Docker is running
[09:39:26.685][Mixpanel       ][Info   ] Usage Statistic: installShowWelcomePopup
[09:39:26.724][Mixpanel       ][Info   ] Usage Statistic: appRunning
[09:39:45.027][NamedPipeClient][Info   ] Sending IsShared(C, MYUSER:**********)...
[09:39:45.033][NamedPipeServer][Info   ] IsShared(C, MYUSER:**********)
[09:39:45.055][Cmd            ][Info   ] Diese freigegebene Ressource existiert nicht.
[09:39:45.060][Cmd            ][Info   ] 
[09:39:45.065][Cmd            ][Info   ] Sie erhalten weitere Hilfe, wenn Sie NET HELPMSG 2310 eingeben.
[09:39:45.070][Cmd            ][Info   ] 
[09:39:45.075][SambaShare     ][Info   ] "C" is not shared
[09:39:45.085][NamedPipeClient][Info   ] Received response for IsShared
[09:39:45.080][NamedPipeServer][Info   ] IsShared done.
[09:39:45.088][NamedPipeClient][Info   ] Sending TryShare(C, MYUSER:**********)...
[09:39:45.093][NamedPipeServer][Info   ] TryShare(C, MYUSER:**********)
[09:39:45.112][Cmd            ][Info   ] Diese freigegebene Ressource existiert nicht.
[09:39:45.117][Cmd            ][Info   ] 
[09:39:45.121][Cmd            ][Info   ] Sie erhalten weitere Hilfe, wenn Sie NET HELPMSG 2310 eingeben.
[09:39:45.125][Cmd            ][Info   ] 
[09:39:45.129][SambaShare     ][Info   ] "C" is not shared
[09:39:45.132][SambaShare     ][Info   ] Creating share "C:\" as "C" with Full Control to "MYUSER"
[09:39:45.183][Cmd            ][Info   ] C wurde erfolgreich freigegeben.
[09:39:45.188][Cmd            ][Info   ] 
[09:39:45.208][Cmd            ][Info   ] Freigabename          C
[09:39:45.212][Cmd            ][Info   ] Pfad                  C:\
[09:39:45.214][Cmd            ][Info   ] Beschreibung          
[09:39:45.217][Cmd            ][Info   ] Max. Benutzer         Unbegrenzt
[09:39:45.219][Cmd            ][Info   ] Benutzer              
[09:39:45.221][Cmd            ][Info   ] Zwischenspeichern     Zwischenspeicherung deaktiviert
[09:39:45.223][Cmd            ][Info   ] Berechtigung          COMPANY\MYUSER, FULL
[09:39:45.225][Cmd            ][Info   ] 
[09:39:45.227][Cmd            ][Info   ] Der Befehl wurde erfolgreich ausgefhrt.
[09:39:45.230][Cmd            ][Info   ] 
[09:39:45.232][SambaShare     ][Info   ] "C" is shared
[09:39:45.236][SambaShare     ][Info   ] Challenging credentials with host
[09:39:45.375][SambaShare     ][Info   ] Challenging credentials with host succeeded
[09:39:45.380][NamedPipeClient][Info   ] Received response for TryShare
[09:39:45.382][NamedPipeClient][Info   ] Sending IsShared(C, MYUSER:**********)...
[09:39:45.377][NamedPipeServer][Info   ] TryShare done.
[09:39:45.385][NamedPipeServer][Info   ] IsShared(C, MYUSER:**********)
[09:39:45.403][Cmd            ][Info   ] Freigabename          C
[09:39:45.406][Cmd            ][Info   ] Pfad                  C:\
[09:39:45.408][Cmd            ][Info   ] Beschreibung          
[09:39:45.411][Cmd            ][Info   ] Max. Benutzer         Unbegrenzt
[09:39:45.413][Cmd            ][Info   ] Benutzer              MYUSER                
[09:39:45.415][Cmd            ][Info   ] Zwischenspeichern     Zwischenspeicherung deaktiviert
[09:39:45.418][Cmd            ][Info   ] Berechtigung          COMPANY\MYUSER, FULL
[09:39:45.420][Cmd            ][Info   ] 
[09:39:45.422][Cmd            ][Info   ] Der Befehl wurde erfolgreich ausgefhrt.
[09:39:45.425][Cmd            ][Info   ] 
[09:39:45.427][SambaShare     ][Info   ] "C" is shared
[09:39:45.430][SambaShare     ][Info   ] Challenging credentials with host
[09:39:45.456][SambaShare     ][Info   ] Challenging credentials with host succeeded
[09:39:45.461][NamedPipeClient][Info   ] Received response for IsShared
[09:39:45.458][NamedPipeServer][Info   ] IsShared done.
[09:39:45.466][NamedPipeClient][Info   ] Sending Mount(C, MYUSER:**********)...
[09:39:45.469][NamedPipeServer][Info   ] Mount(C, MYUSER:**********)
[09:39:45.473][HyperV         ][Info   ] Mount /C;/c
[09:39:45.476][PowerShell     ][Info   ] Run script with parameters: -Mount True -Credential System.Management.Automation.PSCredential -MountPoints /C;/c...
[09:39:45.899][HyperV         ][Info   ] Un-Mount volume /C;/c
[09:39:45.931][HyperV         ][Info   ] Mounting host filesystem
[09:39:45.957][HyperV         ][Info   ] Mounting with user MYUSER
[09:39:45.990][NamedPipeClient][Info   ] Received response for Mount
[09:39:45.987][NamedPipeServer][Info   ] Mount done.
[09:40:07.953][ProxyProcess   ][Info   ] proxy >> GET /v1.24/containers/json?all=1
[09:40:07.956][ProxyProcess   ][Info   ] Dial Hyper-V socket 636e9213-3c26-470b-af8e-a8a49d638b31:23a432c2-537a-4291-bcb5-d62504644739
[09:40:07.959][ProxyProcess   ][Info   ] proxy << GET /v1.24/containers/json?all=1
[09:40:11.908][ProxyProcess   ][Info   ] proxy >> GET /v1.24/images/json
[09:40:11.911][ProxyProcess   ][Info   ] Dial Hyper-V socket 636e9213-3c26-470b-af8e-a8a49d638b31:23a432c2-537a-4291-bcb5-d62504644739
[09:40:11.914][ProxyProcess   ][Info   ] proxy << GET /v1.24/images/json
[09:40:20.837][ProxyProcess   ][Info   ] proxy >> POST /v1.22/images/create?tag=latest&fromImage=beast.COMPANY.local%3A5000%2Fpostgis-bdr
[09:40:20.839][ProxyProcess   ][Debug  ] com.docker.slirp.exe: DNS[c247] 192.168.65.2:52178 -> 192.168.65.1 c247 Query:0 na:c:r:rn 0 <qs:beast.COMPANY.local. <AAAA|IN>> <an:> <au:> <ad:>
[09:40:20.844][ProxyProcess   ][Debug  ] com.docker.slirp.exe: DNS[c247] Forwarding to 10.0.75.1
...

Those german bits mean the resource doesn't exist (Diese freigegebene Ressource existiert nicht.) and the command ran successfully (Der Befehl wurde erfolgreich ausgefhrt.) respectively (before you have to look it up: Zwischenspeichern Zwischenspeicherung deaktiviert = caching deactivated; Berechtigung = authorization).

Things I've tried:

Sometimes it works and sometimes it doesn't - I can't really see where there should be a difference (I didn't do anything but click and apply it again for a couple of times). The only thing that apparently never works is doing it while containers (with or without volumes of the hostsystem mounted) are running.

patrick-mota commented 8 years ago

Instead of docker run -v c:/Users:/data alpine ls /data

You can use /c/Users:/data alpine ls /data

Details: PS C:\Windows\system32> docker run -v /c/Users:/data alpine ls /data Unable to find image 'alpine:latest' locally latest: Pulling from library/alpine e110a4a17941: Pull complete Digest: sha256:3dcdb92d7432d56604d4545cbd324b14e647b313626d99b889d0626de158f73a Status: Downloaded newer image for alpine:latest Patrick

It works the same way in my PHPStorm, instead of browsing a local directory I just do /c/Users.........

Hope it helps.

PS: For the cmd in Powershell it was with admin rights

patrick-mota commented 8 years ago

Seems I speaked too fast... it works only for folders, the files aren't mounted.

guybartal commented 8 years ago

i have the same problem on windows 10 OS build 10586.494 with docker 1.12.0-rc4 i can mount only folders, cannot see the files...

luukverhoeven commented 8 years ago

@guybartal I have the same problem with hyper V as driver. Only empty folders showing up. ` volumes:

guybartal commented 8 years ago

happy to tell that after resetting to factory defaults i can see the files also!

daaps commented 8 years ago

I tried everything, None works, at least for me.

KekSfabrik commented 8 years ago

So with 1.12.0-rc4-beta20 (5579) it has the same Problem (but fails to mount the share 100% of the time) - the Log output has changed:

[07:44:12.654][NamedPipeClient][Info   ] Received response for TryShare
[07:44:12.651][NamedPipeServer][Info   ] TryShare done.
[07:44:22.328][Auth           ][Info   ] Storing credentials: Administrator:***********
[07:44:26.464][NamedPipeClient][Info   ] Sending TryShare(C, Administrator:**********)...
[07:44:26.473][NamedPipeServer][Info   ] TryShare(C, Administrator:**********)
[07:44:26.500][Cmd            ][Info   ] Freigabename          C
[07:44:26.504][Cmd            ][Info   ] Pfad                  C:\
[07:44:26.507][Cmd            ][Info   ] Beschreibung          
[07:44:26.510][Cmd            ][Info   ] Max. Benutzer         Unbegrenzt
[07:44:26.512][Cmd            ][Info   ] Benutzer              
[07:44:26.515][Cmd            ][Info   ] Zwischenspeichern     Zwischenspeicherung deaktiviert
[07:44:26.517][Cmd            ][Info   ] Berechtigung          COMPANY\MYUSER, FULL
[07:44:26.520][Cmd            ][Info   ] 
[07:44:26.522][Cmd            ][Info   ] Der Befehl wurde erfolgreich ausgefhrt.
[07:44:26.525][Cmd            ][Info   ] 
[07:44:26.527][SambaShare     ][Info   ] "C" is shared
[07:44:26.530][SambaShare     ][Info   ] Challenging credentials with host
[07:44:26.562][SambaShare     ][Error  ] Credentials challenge failed with code 2: Systemfehler 86 aufgetreten.

Das angegebene Netzwerkkennwort ist falsch.

[07:44:26.565][SambaShare     ][Info   ] Removing share C
[07:44:26.581][Cmd            ][Info   ] C wurde erfolgreich gel”scht.
[07:44:26.584][Cmd            ][Info   ] 
[07:44:26.586][SambaShare     ][Info   ] Creating share "C:\" as "C" with Full Control to "Administrator"
[07:44:26.634][Cmd            ][Info   ] C wurde erfolgreich freigegeben.
[07:44:26.637][Cmd            ][Info   ] 
[07:44:26.654][Cmd            ][Info   ] Freigabename          C
[07:44:26.658][Cmd            ][Info   ] Pfad                  C:\
[07:44:26.660][Cmd            ][Info   ] Beschreibung          
[07:44:26.662][Cmd            ][Info   ] Max. Benutzer         Unbegrenzt
[07:44:26.664][Cmd            ][Info   ] Benutzer              
[07:44:26.666][Cmd            ][Info   ] Zwischenspeichern     Zwischenspeicherung deaktiviert
[07:44:26.667][Cmd            ][Info   ] Berechtigung          CORVUS\Administrator, FULL
[07:44:26.669][Cmd            ][Info   ] 
[07:44:26.671][Cmd            ][Info   ] Der Befehl wurde erfolgreich ausgefhrt.
[07:44:26.673][Cmd            ][Info   ] 
[07:44:26.675][SambaShare     ][Info   ] "C" is shared
[07:44:26.677][SambaShare     ][Info   ] Challenging credentials with host
[07:44:26.705][SambaShare     ][Error  ] Credentials challenge failed with code 2: Systemfehler 86 aufgetreten.

Das angegebene Netzwerkkennwort ist falsch.

Translations: Das angegebene Netzwerkkennwort ist falsch. wrong network password; C wurde erfolgreich gelöscht. C was successfully removed/deleted.. So it looks like it's able to share (when it isn't) and neither using the boxname (CORVUS) as login domain (login as CORVUS\MYUSER) nor as local admin or with my network credentials..

This is annoying since I'm trying to get my colleagues to work with docker on their local machines of which 100% run Windows (on the positive side: i haven't had any problem whatsoever in months with d4osx)

patrick-mota commented 8 years ago

Like @guybartal since the last update, after a reset of docker it works perfectly... (if you mind I tried with the default driver it works too..)

PS C:\Users\Patrick\Documents\GitHub\docker-php-xdebug-vscode> docker volume create --name silex

PS C:\Users\Patrick\Documents\GitHub\docker-php-xdebug-vscode> docker run --volume-driver=glusterfs --volume /c/Users/Patrick/Downloads/docker-compose-nginx-silex:/silex alpine ls -l /silex

total 133 -rwxr-xr-x 1 root root 1065 Jul 20 10:05 LICENSE -rwxr-xr-x 1 root root 120 Jul 20 10:05 README.md drwxr-xr-x 2 root root 0 Jul 20 10:05 bin -rwxr-xr-x 1 root root 1289 Jul 20 12:40 composer.json -rwxr-xr-x 1 root root 121283 Jul 20 12:52 composer.lock drwxr-xr-x 2 root root 0 Jul 20 10:05 config drwxr-xr-x 2 root root 0 Jul 20 10:05 docker -rwxr-xr-x 1 root root 229 Jul 20 10:05 docker-compose.yml -rwxr-xr-x 1 root root 748 Jul 20 10:05 phpunit.xml.dist drwxr-xr-x 2 root root 0 Jul 20 10:05 src drwxr-xr-x 2 root root 0 Jul 20 10:05 templates drwxr-xr-x 2 root root 0 Jul 20 10:06 tests drwxr-xr-x 2 root root 0 Jul 20 10:06 var drwxr-xr-x 2 root root 0 Jul 20 12:52 vendor drwxr-xr-x 2 root root 0 Jul 20 10:06 web`

daaps commented 8 years ago

Ok, so for me the problem it seems it was the fact that the password contained special chars. After i changed my password, worked. At least for now.

dgageot commented 8 years ago

@daaps can you share the special chars you used?

KekSfabrik commented 8 years ago

from my experience even a password containing an exclamationmark (!) is enough to trip it up.. i have not however tried changing my password

dgageot commented 8 years ago

@KekSfabrik That's surprising since all our integration tests run on machines with an exclamation mark in the password. I would be really glad to hear your experience if you use another password. Thanks a lot!

mfacenet commented 8 years ago

I can verify it happens with @ in the password (may also be related to using a live account vs. a local account)

mborejdo commented 8 years ago

I seem to have problems using a # in the password

KekSfabrik commented 8 years ago

@dgageot I tried it and while it somehow worked yesterday on the old RC version (even with the !) it doesn't work now with the version it updated me to (1.12.0-beta21 (build: 5971 - 5b59d37)) - neither with nor without the !

[08:40:36.216][Auth           ][Info   ] Storing credentials: MYUSER:***********
[08:40:38.265][Auth           ][Error  ] Failed to retrieve the user's credentials: Der angeforderte Vorgang kann nicht abgeschlossen werden. Dem Computer muss für Delegierungszwecke vertraut werden und das aktuelle Benutzerkonto muss für die Zulassung von Delegationszwecken konfiguriert werden.

Suggests the winbox or my user account isn't configured for delegation (it's a domain login).. I'll try switching to the stable version and try again

EDIT Works fine with the stable version 1.12.0-beta21 (build: 5971 - 9cd1dc2) - i haven't changed my password to include special characters again though

zer0beat commented 8 years ago

@daaps I had problems using $ in the password. I changed the password removing $ and all is working fine. Thanks for the workaround.

Jonathan34 commented 8 years ago

it is a requirement in my company to have special characters and i face the same issue. Whatever/However i mount, I see 0 content in the container. i guess i ll have to share files via a git repo i guess

protubero commented 8 years ago

I have also problems to mount host volumes without having special characters in my password!?

Resetting had no effect.

jakobnotseth commented 8 years ago

I'm having this issue as well, no special characters though unless you count norwegian letters as special (æøå)... Using Docker Version 1.12.1-stable (build:7135) on Windows 10 Enterprise 10.0.14393.

ghost commented 8 years ago

I've experienced this problem too. It seems to manifest if I run Kitematic.

jakobnotseth commented 8 years ago

I'm able to map the volume from local to docker, so using alpine image, I can list (ls) the folder I mapped. But all files in the folder mapped is mapped as folders and not files, rendering it useless. Also creating files inside alpine in this folder does not create files on the host.

andriykrasnychuk commented 7 years ago

The same problem with mapping files (folders work) on Docker version 1.12.3, build 6b644ec. Using windows 10 Pro version: 1607 build: 14393.576

thaJeztah commented 7 years ago

@andriykrasnychuk the windows platform does not support bind-mounting individual files; that's a limitation of the Windows platform, see; https://docs.docker.com/engine/reference/commandline/run/#/mount-volume--v---read-only

The following examples will fail when using Windows-based containers, as the destination of a volume or bind-mount inside the container must be one of: a non-existing or empty directory; or a drive other than C:. Further, the source of a bind mount must be a local directory, not a file.

jakobnotseth commented 7 years ago

@thaJeztah So far I can't see this discussion being at all about mapping individual files, but mapping folders.

SG5 commented 7 years ago

How can I share drive if my account doesn't have password? When I leave password field empty "OK" button is disabled

thaJeztah commented 7 years ago

@SG5 can you report that issue in the docker for windows issue tracker? Looks like that's something to be addressed there (as the GUI is not part of this repository); https://github.com/docker/for-win/issues

djamalouch commented 7 years ago

I had the same problem without any special chars in my windows password. But the issues might have started when I changed my password... but I'm not quite sure about that. Resetting credentials in the Docker GUI didn't help, but resetting the Docker GUI to factory defaults did!

ups216 commented 7 years ago

I had the same problem with -v .:/src the mapping seems work, but when I get into the container, the folder is empty. then I change it to -v /c/foldername:/src then it worked.

this is only happening on my clean installed windows 10 with only docker for windows installed, my daily working machine seems work fine. (both of them are VMs running on vmware)

thaJeztah commented 7 years ago

The -v flag expects an absolute path for the host-directory if you're using bind-mounts

yanivm commented 7 years ago

I had to restart my docker (Quit Docker, then run it again) in order to view the mounted volumes...

(host: Windows 10 Pro, version 1607; docker: Client version 17.03.0-ce, Server version 1.13.1)

djamalouch commented 7 years ago

This morning I changed my Windows password and suddenly Docker had problems when mounting volumes (no files inside mounted volumes!). I reset the docker credentials on the shared drives settings page and typed in my new password. Then it worked.

Windows 10 Pro, Version 1607, Build 14393.1066 Docker version 17.03.1-ce, build c6d412e

Double-A-92 commented 7 years ago

@SG5 If your main windows account doesn't have a password and you don't want to set one, you can simply create another user specially for docker.

francoispluchino commented 7 years ago

I share my experience to work around the issue of the mounting of volume without changing my password, if it can help.

For those who use Docker Toolbox with Windows 10, there may be a solution to get the mount of shared folders, and not have an empty folder and unmounted volume issues with Docker Compose. For Windows 10 Pro with Hyper-V, I don't know if there is an equivalent procedure.

By default, in the VM configuration in Virtualbox, only c:\Users folder is shared to c/Users, And the mounting of folders and volumes work fine if your workspace is in c:\Users (ex c:\Users\John\MyProject). However, if you want to use another folder (ex. d:\www\MyProject), The folder is empty in the container and volumes are not mounted.

To fix the problem, you must change the configuration of the share folders of the VM in Virtualbox, adding the folder to share, and especially keep the same tree, ex. d:\www vers d/www (and not only www).

If you do not keep the tree structure, the mounting of volumes will not work. Bug or not, by changing the config in this way, everything works correctly, and I lost a lot of time for this subtlety.

Windows 10 Home 64bit, 1703 Build 15063.413 Virtualbox 5.1.22r115126 Docker 17.05.0-ce, build 89658be

thaJeztah commented 3 years ago

closing, as this went stale and is really old now