Docker Community Forums

Share and learn in the Docker community.

Volume mounts in windows does not work

my solution integrated several of the above solutions.

so for me:

  1. change my local windows account password to something that doesn’t have special characters in it.
  2. turn off windows firewall
  3. reset credentials on shared drives and when entering user name prefix with local computer name

that finally did the trick

This solved my issue too http://support.kaspersky.com/us/12092#block1 is where to look for this.

The feature “SMB/CIFS File Sharing Support” is required also, please add this to the document!

@friism when I try running the commands you posted a couple posts above

docker run --privileged -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker alpine sh

docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh

chroot /host

mount -t cifs //10.0.75.1/C /C -o username=,password=,noperm

I get a mount error(115): Operation in progress. Pinging 10.0.75.1 results in 100% package loss, traceroute fails. Pinging the Linux VM from Windows works just fine. I have deactivated the Windows FW on the host for the 10.0.75.1 interface, but no improvement. Browsing \\10.0.75.1\C from the host works fine, so the share is active and accessible.
I then checked the routing table in the Linux VM and found that there are 2 default GWs configured (10.0.75.1 and 192.168.65.1), which normally is not a good thing and could explain the failing ping and traceroute.

I also found that the system time was way off (22h in the past). Even if everything else would have been ok, Windows would have treated all requests as replay attack and thus rejected them. I manually corrected it, but it might make sense to leverage NTP to ensure proper system time.

I’ve been also struggling with this problem for a while and I’ve found a working a solution (at least for me). I have a corporate machine, Windows 10 Enterprise, inside an Active Directory (my account is an AD account). I also created a local admin account to test.

So it’s kind of obvious that the problem is somewhere between the mobylinux and the host windows10. I wanted to try to mount the C drive directly from mobylinux I couldn’t do that so I created a another VM (it was an Ubuntu) on the same network (DockerNAT) and started to play. I just tried to mount the C drive of the host Windows and list it.

The working commands:
mount -t cifs //10.0.75.1/C /mnt/share -o username=<AD_username without domain>,password=<AD_password>
mount -t cifs //10.0.75.1/C /mnt/share -o username=<AD_username without domain>,password=<AD_password>,domain=<AD_domain>
mount -t cifs //10.0.75.1/C /mnt/share -o username=<local_admin_username>,password=<local_admin_passoword>,domain=<machine_name>

The non-working commands:
mount -t cifs //10.0.75.1/C /mnt/share -o username=<AD_Domain>&lt;AD_username without domain>,password=<AD_password>
mount -t cifs //10.0.75.1/C /mnt/share -o username=<machine_name>&lt;local_admin_username>,password=<local_admin_passoword>

Unfortunately there is no way to define explicitly the domain with the Docker for Windows so finally I entered my AD username without password and it started to work!

So I guess it could be fixed making the configuration more flexible.

Had the same issue on Windows 10, I solved adding the Users users on the Sharing settings of D:

1 Like

Thanks @ruloweb - that fixed it for me

Make sure to allow the drive on which the folder is located through to the containers in the docker settings:
Docker tray > Settings > Shared drives > Tick the drive on which the folder is located.

Changing unidentified networks to private fixed it for me. Is there a way to only apply this to the Docker network?

You´ve just saved my day, tks

Thanks @ijeweb, this was very helpful. I ended up changing the specific interface to private instead of changing the ‘unidentified Networks’ policy. The following PowerShell command did it:

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

I also ran into other issues so I wrote a shell script to manually mount the share:

2 Likes

Hi,
where should I run this script? I have tried in a windows powershell and then in a privileged Ubuntu container

regards
graham

I run it in Windows using Cygwin.

thanks, funny I am using docker precisely so I dont have to install Cygwin :slight_smile:

Here’s a raw equivalent in PowerShell:

$drive = $env:homedrive.Substring(0,1)

$ip = Get-NetIPConfiguration -InterfaceAlias "vEthernet (DockerNAT)" | Select IPv4Address
$unc = "//" + $ip.IPv4Address.IPAddress + "/" + $drive

[Environment]::SetEnvironmentVariable("UNC", $unc, "Process")
[Environment]::SetEnvironmentVariable("DRIVE", $drive, "Process")
docker run -ti --rm --privileged --pid=host -e USERNAME -e USERDOMAIN -e DRIVE -e UNC ubuntu nsenter --target 1 --mount --uts --ipc --net --pid sh -x -c '
  [ -d "/${DRIVE}" ] || mkdir "/${DRIVE}" && \
  mount.cifs "${UNC}" "/${DRIVE}" \
    -o "user=${USERNAME},domain=${USERDOMAIN},noperm,forceuid,mfsymlinks,file_mode=0700,dir_mode=0700,nobrl,vers=3.0"
'
1 Like

thanks for that conversion. unfortunately back to volumes not working on windows with very little idea why, I get 115 operation pending error when I manually try the mount. I am on the pre-release windows program and it is a bit of a crap shoot when a new windows build comes along whether docker mounts will work.

Running Win10 Pro (build 1607)
Docker version 1.12.1

Unfortunately, still experience the same issue. Tried all solutions above multiple times. Additionally tried to install beta version of Docker for Windows with no success. Here are my observations:

  1. When I follow this approach I can get host folder mounted properly and sharing seems to work. However, I have no clue what do I supposed to do next. This workaround seems to be temporary and sharing drops as soon as I quit the container.
  2. User name & password contain only [a-zA-Z] chars
  3. \\10.0.75.1\C shows the list of files properly
  4. Shared Drives in Docker app configured properly (tried all combinations of username with ip/machine names mentioned in the topic)
  5. Firewall & Antivirus are disabled
  6. This PS script throws mount error(112): Host is down. But it’s certainly up.
  7. Played with shared folders through Kitematic, the sharing didn’t work either.
  8. Unidentified networks resolve as private
  9. The file log contains:

[SambaShare ][Info ] “C” is shared
[SambaShare ][Info ] Challenging credentials with host
[SambaShare ][Info ] Challenging credentials with host succeeded
[NamedPipeServer][Info ] TryShare done.
[NamedPipeClient][Info ] Received response for TryShare
[NamedPipeClient][Info ] Sending Mount(C, Spleshka:)…
[NamedPipeServer][Info ] Mount(C, Spleshka:
)
[HyperV ][Info ] Mount C
[NamedPipeClient][Info ] Received response for Mount
[NamedPipeClient][Info ] Sending Unmount(D)…
[NamedPipeServer][Info ] Mount done.
[NamedPipeServer][Info ] Unmount(D)
[HyperV ][Info ] Unmount D
[NamedPipeClient][Info ] Received response for Unmount
[NamedPipeServer][Info ] Unmount done.
[ApiProxy ][Info ] proxy >> POST /v1.24/containers/create [rewriteBinds]
[ApiProxy ][Info ] Rewrote mount c:/Users:/data (volumeDriver=) to /c/Users:/data
[ApiProxy ][Info ] Failed to Walk to [snapshots 1407707c5776aafac0c5278b2623c29b845ab6c7 ro com.docker.driver.amd64-linux proxy http] 9p: No such file or directory

Any ideas guys what I could have missed? Will appreciate any help, nearly give up trying.

I am able to easily mount volumes when running a container:
docker run -v c:/src:/src imageName:tag

However I am unable to mount a windows volume from a docker file or a docker compose yml file when trying to build a image.

VOLUME c:/src:/src

What I am trying to do is to build dotnet core applications from a container rather than build that application on the host and copying the binaries into the container that runs.

I finally solved it! just add / before c as:

-v “/c:/Users/samir/Documents/Workspace”:/usr/src/lambda

or, even better:

-v /$(“pwd”):/usr/src/lambda

1 Like

After following this thread for a few weeks now and trying (almost) everything, I finally got it working.

I enabled NFS-Services in the ‘Install optional features’-popup and now everything works as expected! Just wanted to leave this here as a hint for anybody who followed this thread and didn’t have any success so far…