Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Error with pre-create check: "Hyper-V PowerShell Module is not available" When creating a new docker machine #4452

Open
Codewizard opened this issue Apr 13, 2018 · 31 comments

Comments

@Codewizard
Copy link

#4342 is a closed issue but this issue is not resolved.

Version: 0.14.0, build 89b8332
image

@danielgerlag
Copy link

+1

1 similar comment
@vitdo82
Copy link

vitdo82 commented Apr 14, 2018

+1

@Draki
Copy link

Draki commented Apr 14, 2018

Further research showed me that the issue is already solved through #4424, but the version 0.14.1 with the fix still unreleased...

@isjo-org
Copy link

+1

3 similar comments
@dungwd
Copy link

dungwd commented Apr 16, 2018

+1

@kashyapvirgo
Copy link

+1

@bbenetskyy
Copy link

+1

@moozoo64
Copy link

+1
Hyper-v is the preferred solution for docker machine running on windows. Yet the stable release of docker for windows ships with a broken version that can't use hyper-v
I can't get "docker-machine create --driver hyperv test" to work without downloading the 0.13.0 executable and using it.
Please release a docker for windows with the fixed 0.14.01 docker-machine as a matter of some urgency.
I'm finding stable docker for windows littered with bugs. Docker-machine env driverNoneMachine gives a docker_host variable with a URL that docker info can't consume. I have to manually fix the docker_host variable . And the list goes on...

@palaniichukdmytro
Copy link

+1

1 similar comment
@rendner
Copy link

rendner commented Apr 18, 2018

+1

@Codewizard
Copy link
Author

Just to let you guys know, if you need this right now the workaround is to downgrade your docker-machine file (in windows Located in either C:\Program Files\Docker Toolbox or C:\Program Files\Docker\Docker\resources\bin) with the v0.13.0 version located here https://github.com/docker/machine/releases/tag/v0.13.0. I was able to get it to work with this.

@chilio
Copy link

chilio commented Apr 19, 2018

v0.13.0 solution worked for me initially, but unfortunately (and @moozoo64 is right about that), digging deeper, it created other problems like HTTP/1.x transport connection broken: malformed HTTP response, and also other errors on Windows 10 in hyperv mode.
I keep in mind that these errors might also be caused by version incompatibility, since in this workaround we are downgrading only part of the package..
Therefore, for now, I'm not going to investigate it in details any more,...
Heading back to Linux for further exploration of new docker capabilities...

@scmikes
Copy link

scmikes commented Apr 19, 2018

+1

1 similar comment
@thinklot
Copy link

+1

@scmikes
Copy link

scmikes commented Apr 19, 2018

FYI, the workaround does not work on widows 2016 server

I did try an exe built from master on 4/18/18 11:00PM and it got past the pre-machine check on windows 10 and windows 2016. But failed later on other issue. I am filing isssues for what I find

@YAMLcase
Copy link

+1

1 similar comment
@thosuperman
Copy link

+1

@xnng
Copy link

xnng commented May 6, 2018

+1
v0.13.0 also error
_20180506213333

@cliffordacion
Copy link

+1

1 similar comment
@feelsteps
Copy link

+1

@DmytroRybka
Copy link

Same problem

@Jdubedition
Copy link

+1

1 similar comment
@Fredoid
Copy link

Fredoid commented May 17, 2018

+1

@stetsd
Copy link

stetsd commented May 22, 2018

++

@thomasdane
Copy link

+1

1 similar comment
@macyan13
Copy link

macyan13 commented Jun 8, 2018

+1

@gmsantos
Copy link

gmsantos commented Jun 8, 2018

Also related with #4424

@webstandardcss
Copy link

Here is the solution

https://github.com/docker/machine/releases/download/v0.15.0/docker-machine-Windows-x86_64.exe

Save the downloaded file to your existing directory containing docker-machine.exe.

For my system this is the location for docker-machine.exe
/c/Program Files/Docker/Docker/Resources/bin/docker-machine.exe

Backup the old file and replace it file with the new one.

cp docker-machine.exe docker-machine.014.exe

Rename the downloaded filename to docker-machine.exe

mv docker-machine-Windows-x86_64.exe docker-machine.exe

Build Instructions

  1. Create virtual switch in Hyper-V manager named myswitch
  2. Request Docker to create a VM named myvm1

docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

Results

docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

Running pre-create checks...
(myvm1) Image cache directory does not exist, creating it at C:\Users\Trey Brister\.docker\machine\cache...
(myvm1) No default Boot2Docker ISO found locally, downloading the latest release...
(myvm1) Latest release for github.com/boot2docker/boot2docker is v18.05.0-ce
(myvm1) Downloading C:\Users\Trey Brister\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.05.0-ce/boot2docker.iso...
(myvm1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(myvm1) Copying C:\Users\Trey Brister\.docker\machine\cache\boot2docker.iso to C:\Users\Trey Brister\.docker\machine\machines\myvm1\boot2docker.iso...
(myvm1) Creating SSH key...
(myvm1) Creating VM...
(myvm1) Using switch "myswitch"
(myvm1) Creating VHD
(myvm1) Starting VM...
(myvm1) Waiting for host to start...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe env myvm1

@ilan-schemoul
Copy link

@webstandardcss thanks, I've noticed that even w/o creating a switch it works just fine. So weird that for so many months a very major bug that has been introduced hasn't been fixed, until now.

@webstandardcss
Copy link

webstandardcss commented Jul 18, 2018 via email

@amitpshah01
Copy link

@webstandardcss i faced the same problem and it got fixed following your post. thanks much for the detailed steps, it really helped.

Regards,
Amit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests