Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create Windows docker machine? "Hyper-V PowerShell Module is not available"

I just installed docker and tried to create a Windows (not Linux) docker machine but it failed?

PS C:\> docker-machine.exe create --driver hyperv default
Creating CA: C:\Users\...\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\...\.docker\machine\certs\cert.pem
Running pre-create checks...
Error with pre-create check: "Hyper-V PowerShell Module is not available"

I downloaded the newer version of docker-machine (https://github.com/docker/machine/releases/tag/v0.15.0) and a new error occurred.

PS C:\> .\bin\docker-machine-Windows-x86_64.exe create --driver hyperv default
Running pre-create checks...
Error with pre-create check: "no External vswitch found. A valid vswitch must be available for this command to run. Check https://docs.docker.com/machine/drivers/hyper-v/"
like image 324
ca9163d9 Avatar asked Jun 19 '18 21:06

ca9163d9


2 Answers

Default Switch is what you need!

docker-machine create --driver hyperv --hyperv-virtual-switch "Default Switch" node1

like image 78
LuckyBlakc Avatar answered Sep 25 '22 16:09

LuckyBlakc


When you run a command like the following to create a docker machine,

docker-machine create --driver hyperv hypervdockermachine

you may end up with the following error.

Error with pre-create check: "no External vswitch found. A valid vswitch must be available for this command to run. Check https://docs.docker.com/machine/drivers/hyper-v/"

Take the following steps for creating the docker machine on windows 10.

Type hyper v on windows search and fire up the Hyper-V Manager

Hyper V Manager on Windows 10

Next click Virtual Switch Manager. Create a new external virtual switch

New Virtual Switch

Crate a new virtual switch

enter details for the new virtual switch

Now run the following command.

docker-machine create --driver hyperv --hyperv-virtual-switch docker-machine-external-switch hypervdockermachine

Note that docker-machine-external-switch is the hyperv-virtual-switch that you just created and hypervdockermachine is the name of the docker-machine that are about to create with the above command

like image 21
VivekDev Avatar answered Sep 26 '22 16:09

VivekDev