Closed aharpervc closed 8 years ago
I've seen some reports where the Windows/VirtualBox shared mount wasn't started properly in the virtual machine. Could you try restarting the VirtualBox VM?
Also, if you didn't do so yet, I recommend registering for the Docker for Windows beta, which solves a lot of these issues (https://github.com/docker/docker/issues/21535#issuecomment-201687341). You can register at https://beta.docker.com; feel free to ping me here after you did so, and if you give me your Docker Hub ID (username), I can try getting you into the beta faster
I created the docker machine with Hyper-V, not VirtualBox, however restarting the vm did not seem to change the situation. Docker Hub username is aharper
.
@aharpervc @thaJeztah 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.
@thaJeztah seperately, it might be good to document what machine drivers are expected to have working host volume mounting (only the virtualbox one, as far as I know)
Ah! Yes, the Hyper-V machines don't have this as an option, only VirtualBox (and Docker for Windows)
@friism probably, yes, but that should go in the https://github.com/docker/machine issue tracker. Could you open an issue there?
@aharpervc looks like that answers your question, so I'll close this issue, but feel free to continue the discussion here :+1:
@thaJeztah done: https://github.com/docker/machine/issues/3455
Hopefully that doc change will make its way into the website, which is silent on this critical deficiency and implies that it will work normally.
On Windows, mount directories using:
docker run -v /c/Users/
:/ ...`
@aharpervc I agree we should have something mentioning it. It's sometimes difficult finding the right balance, because this basically is an issue in docker machine, not "docker (engine)", and there's now four possible setups on Windows (native Windows docker, Docker toolbox (VirtualBox), Docker Machine (Hyper-V), and "Docker for Windows (beta)"
This happens for us when using Docker for Windows (beta)
@carrete I'm not on Windows myself, but could you check this section? https://beta.docker.com/docs/windows/troubleshoot/#host-filesystem-sharing
I enabled file and printer sharing on Windows 10, following that section. When I try to enable sharing a local drive using Docker Beta, the username/password screen just keeps popping up again whenever I click submit.
Thanks @thaJeztah . We tried that, but the problem is as @rebeccamadsen describes: https://github.com/docker/docker/issues/22981#issuecomment-221746631. She opened an issue about this: https://github.com/docker/docker/issues/23005
I have the "Docker for Windows" beta, and confirmed that it's still an issue. Additionally, under the "Shared Drives" panel of the Settings screen, the command docker run -v c:/Users:/data alpine ls /data
is suggested, but doesn't work (returns empty listing.... no files in mounted folder)
Apparently there are still some issues with sharing host-mounts on Windows with the Docker for Windows beta. The best source of information currently is the troubleshooting documentation linked above, and this forum topic on the docker for windows beta forum; https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/53
I realize that's not a full answer, but I know the Docker for Windows team is working hard to improve the reliability of this feature on Windows. :blush:
@thaJeztah I have the same problem on my machine. The directory is created in the container but is empty, it is also properly listed in Mounts when I run docker inspect
. However it worked fine last week when I tried it out a couple of times, don't know why it's not working today. I have the Docker Toolbox and VirtualBox setup.
@habbes you could try a reboot of the VM; I heard that helped some people, where VirtualBox file-sharing wasn't started for some reason
@thaJeztah I tried that, tried restarting the docker machine, virtualbox and even the whole computer. Nothing. Let me keep searching for a solution
@thaJeztah It's working now. Not really sure where I went wrong. I notice it works if I map the volume to a directory that doesn't exist in the docker container. If I map it to an existing directory, it comes empty. I don't know whether that's the expected behavior. Thanks anyway.
I have same issue on windows for beta, it creates the folder in the container but doesn't have the contents of the drive from the windows dir
@KevinM2k can you report that issue in the Docker for Windows beta forum? I think there's already a topic for it https://forums.docker.com/c/docker-for-windows
Beyond strange. I've been working on this all day. I'm using Windows 7 and Docker Toolbox. Here's how it started
This might help https://docs.docker.com/docker-for-windows/troubleshoot/#/host-filesystem-sharing
Unfortunately, this setup does not support passwords which contain Unicode characters, so your password must be 8-bit ASCII only.
The guidance in this comment, to change the DockerNAT virtual adapter from public
to private
network type, fixed the issue for me.
I spoke too soon... it worked exactly once, but subsequent docker run
commands still show a blank mounted folder.
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.
I found this process to be very confusing as well.
The documentation seems to suggest that you can either share a complete host volume or a host directory at a specific mount point in the guest.
However, with Hyper-V on Windows 10, I was not able to mount a host directory and see its contents inside the guest. I always ended up with an empty directory.
I had to check my C
drive in the Docker settings as a shared drive and then the directory contents would be visible inside the guest.
@oliversalzburg sorry about the confusion. The docs you want are for Docker for Windows: https://docs.docker.com/docker-for-windows/#/shared-drives
@friism What was confusing me was that I need to share what seems like "the whole drive" so that I can see the contents of a single mounted directory in my container. I don't see how the link you gave me relates to that.
The silent failure here is really unfortunate. When I'm attempting to -v c:/foo:/foo
, I would expect some kind of feedback if I haven't enabled the appropriate setting.
Another, more minor, fix would probably be making the line below Shared Drives fully readable and have it explain what it really means to check one of those boxes.
Select the local drives you want to be able to … your containers.
The part that is cut off there seems very relevant to me to understand the meaning behind these settings.
Anyway, I was primarily just leaving this here, in case anyone was running into the same situation I was :)
@oliversalzburg
share what seems like "the whole drive" so that I can see the contents of a single mounted directory in my container
Yeah, it's not the best. The alternative is worse, though, because Docker would have to share host folders on each container run, and that would potentially pop up the credentials prompt.
The silent failure here is really unfortunate
We agree, and we're working on improving this with a warning or similar
Another, more minor, fix would probably be making the line below Shared Drives fully readable
The text you quoted is not what I'm seeing (and it's not what's in the screenshot above). If you're seeing something else, could you post a screenshot here?
Thanks again for your comments and suggestions!
@friism Huh, I must have read that line like a dozen times and did not parse it correctly. Sorry for the mistake :)
@friism Huh, I must have read that line like a dozen times and did not parse it correctly. Sorry for the mistake :)
Same.
Hi guys
I think I've just revolved the same issue on my W10 :
I moved my windows to latest release (1607) Then I went on Hyper-v to check the VM Management Integration services : I uncheck all an check back all option there (included guest services and data sharing)... Restarted using Docker applet then it workked....
As i upgraded W10 from 1511 to 1607, I do not know if it is my Hyper-v options checking tour which changed any thing... Or the upgrade.
I'll try now to install docker on a Windows Server 2012R2 and will let you know.
@wmario I tried your steps but without upgrading Windows 10. Shared folders are still empty for me inside the guest container. Windows 10 Pro Version 1511 Docker for Windows Version 1.12.0-stable (build: 5968)
Hi Sorry for this I am running latest build of docker 1.21.1-beta25 build 6823... And it is still running.
Si maybe it is the latest w10 hyper-v which revolves the issue... 🙁
I upgraded docker to latest version (again)...
and again my shared drives was broken !!!
So I went to hyper-v console again to check this [image: Images intégrées 1] the last check boxe here was not checked ! again....
So I checked all and restart docker from the docker applet... And it is working again.
Best regards, Willy.
2016-09-14 17:48 GMT+02:00 Willy mario wmario.wm@gmail.com:
Hi Sorry for this I am running latest build of docker 1.21.1-beta25 build 6823... And it is still running.
Si maybe it is the latest w10 hyper-v which revolves the issue... 🙁
@friism Is there a particular reason this is done by asking you for your password instead of using UAC? Relying on Windows' built in elevation mechanism seems like it would be more secure and would bypass the unicode issues we're seeing. If the user doesn't like UAC prompts (e.g. if they're on a dev box) they'll already have the notification level set to low, or will run docker in an elevated process.
@thaJeztah could you please add me to the beta-list? name is SeriousM . I'm running Win10 and my shared folders are empty. Thank you!
@SeriousM there's no beta list, you can install the beta-channel version from here: https://docs.docker.com/docker-for-windows/
Thank you, and sorry for the distribution!
Am 19.09.2016 21:57 schrieb "Michael Friis" notifications@github.com:
@SeriousM https://github.com/SeriousM there's no beta list, you can install the beta-channel version from here: https://docs.docker.com/ docker-for-windows/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/docker/issues/22981#issuecomment-248104922, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcMvYcu0hbCoAIIrHIARdy6npZPyWTjks5qrukqgaJpZM4ImqtR .
I installed Docker with Docker toolbox and this is how I solved it:
Hi I am experiencing the same problem and have exhausted everything i can think of. I am attempting to mount a volume from C:/Users into a container running on a docker-machine using the hyperv driver on docker for windows (win 10 pro). I am a using the lastest docker (1.13.1) and the same on the hyper vm machine. I have tried switching to using a local account, shared the drive in the docker settings menu and ive pretty much tried everything i could find on google.
Running the test volume run command in the settings menu works for me. At this point in time I presume hyperv does not support mounting volumes from the host however i cant find anywhere that explicitly says that volumes mounting will not work in hyperv.
This is my docker-compose config:
networks: {}
services:
app:
build:
context: C:\users\deep\projects\chat\app
command: sleep 3600
image: app
links:
- rethinkdb
- redis
ports:
- 4005:4005
- 4007:4007
volumes:
- /c/users/deep/projects/chat/app:/usr/src/app:rw
redis:
image: redis
rethinkdb:
image: rethinkdb:2.3.5
version: '2.0'
volumes: {}
In my Dockerfile i can see copy files into the container to usr/src/app
. When i up
the services with the volume specified in the compose file the directory is emptied, however i omit this volume mount i can see my files that i copied into the container from the dockerfile.
Running verbose when starting my services i can see a volumes path specified as such 'Binds': [u'/c/users/deep/projects/chat/app:/usr/src/app:rw']
. However, when i inspect the container using docker-compose inspect app
i see volumes set to null "Volumes": null
.
I presume at this point that mounting volumes into a container running inside a hyperv VM is not supported? Can someone confirm so that I can RIP :)
@deep-c Docker for Windows supports bind-mounting host directories (see https://docs.docker.com/docker-for-windows/#shared-drives), however, if you use docker-machine
to create a machine with hyperv
, sharing won't work. I'd recommend to install Docker for Windows instead.
@thaJeztah Thanks for the confirmation! I presume you mean i should install Docker toolbox (and use virtualbox) when you said I'd recommend to install Docker for Windows instead
?
@deep-c No, docker toolbox / VirtualBox should not be needed. If you use Docker for Windows https://docs.docker.com/docker-for-windows/install/, you should be able to use shared drives. Docker for Windows also uses hyper-v, but has additional features in place to allow you to do that. Those features are not there if you create a hyper-v machine with docker-machine.
if you are trying to mount a folder from windows bash and getting empty results, you have to remove /mnt
prefix...
so, instead of --volume /mnt/c/Users:/foo
it should be --volume /c/User:/foo
... Double slash also works --volume //c/User:/foo
Had the same issue This is on windows 10.. Solved it by doing the following Docker Setting -> Shared Drive -> Reset credentials. This was after I had changed my windows password.
@omarramadan I didn't even know I needed to grant those permissions by supplying credentials to the windows partitions 😮 . The tuts didn't really mention that...
@snewell92 could you open an issue for that in the documentation issue tracker? There's a "request documentation changes" link on the page you referred to to open an issue
It's an old post, but this might help: On Windows, antivirus and similar softwares might prevent docker to access the local file system. Even if drive sharing is enabled on docker.
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Steps to reproduce the issue:
Here's my full command history
docker-machine create test-machine
docker run -i -t -v /c/users/aharper/workspace_test_docker_volume:/whatever ubuntu /bin/bash
Describe the results you received:
I expected to see the host folder contents in
/whatever
in the containerDescribe the results you expected:
/whatever
exists in the container but is emptyAdditional information you deem important (e.g. issue happens only occasionally):
Seems to always happen. No errors that I noticed. The mounting process seems to almost work since the folder itself shows up.