Skip to content
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

Docker cannot resolve computer name at start (at New-Switch) #3389

Open
TTTMike opened this Issue Feb 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@TTTMike
Copy link

TTTMike commented Feb 14, 2019

  • I have tried with the latest version of my channel (Stable or Edge)

  • I have uploaded Diagnostics

  • I have included the Diagnostics ID in this Issue

  • Windows 10 Enterprise Version: 10.0.17134 Build 17134

  • Docker for Windows Version: 2.0.0.2 (302515) Channel: Stable Build: 0b030e1

  • Diagnostic ID: 2D6AE455-3020-4236-8ECD-F082E04CBDE3/20190214152146

Expected behavior

Start running

Actual behavior

Stopped with error:
Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The computer '5458' could not be resolved. Make sure you typed the machine name correctly and that you have network access.
at New-Switch, : line 121
at , : line 411
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
at Docker.Actions.<>c__DisplayClass19_0.b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

Information

  • Company computer names are following a 4-digit number scheme
  • Windows 10 Enterprise Version: 10.0.17134 Build 17134
  • Docker for Windows Version: 2.0.0.2 (302515) Channel: Stable Build: 0b030e1

Steps to reproduce the behavior

  • Start Docker
  • Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The computer '5458' could not be resolved. Make sure you typed the machine name correctly and that you have network access.
    at New-Switch, : line 121
    at , : line 411
    at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
    at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
    at Docker.Actions.<>c__DisplayClass19_0.b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
    at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59
@TTTMike

This comment has been minimized.

Copy link
Author

TTTMike commented Feb 19, 2019

Hi,

I've now found the reason for the problem, but I am not able to solve it myself (since I do not have the Docker for Win sources).

1.) Hyper-V cannot correctly resolve the "localhost" when your machine resides inside of a domain
2.) The full name of my computer is: "'5458.some.domain", when running the command "localhost" in powershell, I only get "5458" as computer name. This is in my case, not the full name.
3.) I tried to connect manually with the Hyper-V manager to "Local Computer" or "Another computer": "5458" but as expected, this does NOT work.
4.) When I try to connect to "Another computer": "5458.some.domain" or "127.0.0.1", the connection works perfectly fine.

My first step to a solution was to modify the "MobyLinux.ps1" script in the following way:

1.) Check if the computer is part of a domain -> If yes define a variable $cname = computername+domain
2.) If not: use "hostname" as computer name
3.) Add at all points necessary a "-ComputerName $cname" to the Hyper-V commands.

This solution worked pretty well, I can create the VM but then, the docker executable seems to execute additional Hyper-V commands between 'Create' and 'Start' with no explicit computer name definition. Therefore the Hyper-V commands are executed for the default computer which is "localhost" (which does not work for computers in domains).

Please find my latest log and "MobyLinux.ps1" attached. Maybe you guys can help me further and modify the executable so it works also for computers in domains.

Thanks,
Michael
log.txt
MobyLinux.ps1.txt

@TTTMike

This comment has been minimized.

Copy link
Author

TTTMike commented Feb 19, 2019

Hi,

I've now found a temporary solution for my problem by further "hacking" the script "MobyLinux.ps1".
Please find the updated version attached.

I managed to get docker to start by ,modifying the globally exposed $PSDefaultParameterValues for the required Hyper-V command with my "correct" hostname as computername parameter.

MobyLinux_update.ps1.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.