Cannot create Windows docker machine? “Hyper-V Pow

2019-06-18 13:15发布

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/"

2条回答
对你真心纯属浪费
2楼-- · 2019-06-18 13:19

I had the same problem with the message:

Error with pre-create check: "vswitch \"My Internal Switch\" not found"

I solved the problem by opening my Hyper-V Manager and creating my Virtual Switch in the GUI.

Hyper-V Virtual Switch

Running my same command in the command line then succeeded.

查看更多
三岁会撩人
3楼-- · 2019-06-18 13:22

I believe that you need to create a network switch in Hyper-V Manager and specify it when you create the machine.

For example, if you create an external switch called external-switch then you can specify it like so when you create your machine.

docker-machine create --driver hyperv --hyperv-virtual-switch external-switch [Machine Name]

See this link: https://docs.docker.com/machine/drivers/hyper-v

查看更多
登录 后发表回答