docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 289 forks source link

net use fails in running containers on windowservercore and only works on nanoserver for shares on the host #124

Closed douglaswaights closed 7 years ago

douglaswaights commented 8 years ago

Hi,

net use doesn't appear to work on the windowsservercore image. I get the below trying to map to a shared folder inside a container on the host machine.

PS C:> net use * \dwsp3\git Enter the user name for 'dwsp3': cegal64\douglaswa Enter the password for dwsp3: System error 67 has occurred.

On nanoserver however it does work. C:>net use * \dwsp3\git User name: cegal64\douglaswa Password: Drive Z: is now connected to \dwsp3\git.

The command completed successfully.

Also I notice that when i try and do the same thing with a network share it fails on both nanoserver and windowsservercore.

Thanks Doug

Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 2 Server Version: 1.12.2-cs2-ws-beta-rc1 Storage Driver: windowsfilter Windows: Logging Driver: json-file Plugins: Volume: local Network: nat null overlay transparent Swarm: inactive Security Options: Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160915-0644) Operating System: Windows 10 Enterprise OSType: windows Architecture: x86_64 CPUs: 4 Total Memory: 7.907 GiB Name: dwsp3 ID: GDYU:XNB4:ZU6G:TRLI:4SJ3:KWIV:SX25:6QCJ:PTGO:JDZU:2EFA:CTZ5 Docker Root Dir: C:\ProgramData\Docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Insecure Registries: 127.0.0.0/8

dgageot commented 8 years ago

@friism Any idea?

friism commented 8 years ago

I can mount a network drive just fine:

PS C:\> net use * \\192.168.203.228\C\code\repros
Enter the user name for '192.168.203.228': friism
Enter the password for 192.168.203.228:
Drive Z: is now connected to \\192.168.203.228\C\code\repros.

The command completed successfully.

PS C:\>

This works in both windowsservercore and nanoserver (using the container host hostname):

PS C:\> net use * \\Win-3dnqrpv64jh\c\test
Enter the user name for 'Win-3dnqrpv64jh': Administrator
Enter the password for Win-3dnqrpv64jh:
Drive Z: is now connected to \\Win-3dnqrpv64jh\c\test.

The command completed successfully.

PS C:\>

I don't know about the path you're trying to use. It works me in neither Core nor Nanoserver containers. Maybe @jhowardmsft has ideas.

douglaswaights commented 8 years ago

hmmm.

I just tried again on both base images to check i wasn't going crazy.

Same result for the host share.... it works on nanoserver but not windowsservercore (i havent tried the network share again but most probably the same result).

Additionally I tried using a local admin account for the user password prompt just in case it doesn't like domain accounts for whatever reason... but still the same result.

Windows servercore

C:>net use * \dwsp3\git Enter the user name for 'dwsp3': douglas Enter the password for dwsp3: System error 67 has occurred.

The network name cannot be found.

On nanoserver all is well for the host share Microsoft Windows Version 10.0.14393 2016 Microsoft Corporation. All rights reserved.

C:>net use * \dwsp3\git User name: douglas Password: Drive Z: is now connected to \dwsp3\git.

The command completed successfully.

Probably a silly question i suppose, but are you on the same beta bits and images i am? Running on Windows 10 Hyperv anniversary addition? The images were from 12 days ago.

I'm not sure if it helps or not but interestingly when i start a new container on servercore and just do a net use with no args i get the below Microsoft Windows Version 10.0.14393 2016 Microsoft Corporation. All rights reserved.

C:>net use System error 50 has occurred.

The request is not supported.

C:>

On nanoserver i get the below which obviously looks better Microsoft Windows Version 10.0.14393 2016 Microsoft Corporation. All rights reserved.

C:>net use New connections will be remembered.

There are no entries in the list.

C:>

Thanks Doug

lowenna commented 8 years ago

Are you on the 9D update? (Run Windows Update). It sounds like the Windows firewall as the most likely cause.

douglaswaights commented 8 years ago

In the host? or container?

Just updating my win 10 machine a few updates...

the servercore image is microsoft/windowsservercore latest f20579da8e4e 12 days ago 7.329 GB

lowenna commented 8 years ago

Container

friism commented 8 years ago

@douglaswaights I'm running this in a full VM2016 VM (running containers). I haven't tested on Windows 10.

douglaswaights commented 8 years ago

@jhowardmsft could you point me in the right direction for how to do that in the container? Sorry for being a bit dumb!

douglaswaights commented 8 years ago

ah sconfig figured it out- trying to update now the container now

douglaswaights commented 8 years ago

sconfig is taking an age inspecting the system, i'll report back when and if i manage to get the updates down to the container!

Thanks!

douglaswaights commented 8 years ago

Unfortunately sconfig seems to hang https://github.com/docker/for-win/issues/128

douglaswaights commented 8 years ago

Having not been able to update a running windows server core container, i've been waiting for the GA release of Windows Server 2016 and the associated server core Docker image on Docker Hub to try and see if the 'net use' problem has been resolved for Windows 10 anniversary edition.

Unfortunately the problem still remains (after yesterdays release and new image tag) meaning 'net use' still returns a System error 50 has occurred.

The request is not supported.

This is a blocker for myself, as containerized applications can't see network drives and as a developer this needs to work on Windows 10 hyperv not only on native Windows Server 2016 OS....this is where development is done! I would imagine this will be a blocker for many other developers also.

It would be good to know if there are any work-arounds for this, or if anyone has had success on Windows 10. It's possible to some degree on nanoserver (mapped drives on the local machine although not network drives). It would also be good to know if this is on the radar for an upcoming Docker release or Server Core release patch (whichever is needed).

Would also be good to know if its possible (and if so how) to get Windows updates into a Server core container or image.

Thanks Doug

lowenna commented 8 years ago

I think you might be running up against a known issue being tracked internally and is currently a candidate for a future servicing update.

It's specific to Hyper-V containers (as opposed to a Windows Server container where net use works fine, although you have to be running Windows Server 2016 rather than client Windows 10 to support Windows server containers), and also specific to the windowsservercore image rather than the nanoserver image.

The problem as I understand it is a dependency issue in the packaging of the base image, where the lanman service has a dependency on bowser service in the utility VM. I'm not sure if there's a feasible workaround currently using windowsservercore and Hyper-V containers.

douglaswaights commented 8 years ago

@jhowardmsft OK good to know its being tracked and hopefully not too far away :-). Thanks for the update!

lowenna commented 8 years ago

Here's a workaround :smile:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>sc qc lanmanworkstation
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: lanmanworkstation
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\System32\svchost.exe -k NetworkService
        LOAD_ORDER_GROUP   : NetworkProvider
        TAG                : 0
        DISPLAY_NAME       : Workstation
        DEPENDENCIES       : Bowser
                           : MRxSmb20
                           : NSI
        SERVICE_START_NAME : NT AUTHORITY\NetworkService

C:\>sc config lanmanworkstation depend= "MrxSmb20/NSI"
[SC] ChangeServiceConfig SUCCESS

C:\>sc qc lanmanworkstation
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: lanmanworkstation
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\System32\svchost.exe -k NetworkService
        LOAD_ORDER_GROUP   : NetworkProvider
        TAG                : 0
        DISPLAY_NAME       : Workstation
        DEPENDENCIES       : MrxSmb20
                           : NSI
        SERVICE_START_NAME : NT AUTHORITY\NetworkService

C:\>sc start lanmanworkstation

SERVICE_NAME: lanmanworkstation
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 2  START_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x7d0
        PID                : 1372
        FLAGS              :

C:\>net use * \\<redacted>\e$
Enter the user name for '<redacted>': <redacted>
Enter the password for <redacted>:
Drive Z: is now connected to \\<redacted>\e$.

The command completed successfully.

C:\>
douglaswaights commented 8 years ago

@jhowardmsft Thanks! This got me a bit further.

Doing the work around i can type ´net use´and it lists 0 connections rather than errors. If i then do net use * \dwp3\git (which is a share on my local laptop) i can map the drive.... as i´m able to on nano server.

However it still wont let me map network shares (i guess you expected this) which is the objective.

Another related? observation... (my laptop is on a domain and am doing the above from home not on the network) is that if i vpn in to my office first and then launch a container, the above net use * \dwp3\git doesn´t work and errors as before the workaround.

Thanks Doug

dgageot commented 7 years ago

@douglaswaights @jhowardmsft Hi, is this something fixed in recent versions? FYI, Docker for Windows Beta31 was released yesterday, maybe you can give it a try.

lowenna commented 7 years ago

@dgageot To be clear, this is a bug in Windows and the base image. It's not something DfW is going to be able to fix. FWIW, it hasn't been serviced in 14393.447.amd64fre.rs1_release_inmarket.161102-0100. I'm not sure if it's due in the December update though.

dgageot commented 7 years ago

@jhowardmsft Thanks a lot for the information. @douglaswaights I'm going to close this issue since it's not something Docker for Windows can fix

docker-robott commented 4 years ago

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