windows - Docker机器无法使用hyperv成功到达IP地址/机器

标签 windows docker ip

我尝试使用以下命令在 Windows 10 上使用 hyperv 创建一台机器:

docker-machine create --driver hyperv default

但它给了我:

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

这是完整的输出:

$ docker-machine create --driver hyperv default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\Eugene\.docker\machine\cache\boot2docker.iso to C:\Users\Eugene\.docker\machine\machines\default\boot2docker.iso...
(default) Creating SSH key...
(default) Creating VM...
(default) Using switch "DockerNAT"
(default) Creating VHD
(default) Starting VM...
(default) 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...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
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 default

虽然我可以默认通过 docker-machine ssh 连接机器。

首先我认为这个错误是由也安装的 virtualbox 引起的,但删除它没有帮助。以及删除 .docker 文件夹。

请帮忙。提前致谢。

最佳答案

您应该尝试添加一个 Hyper-V 虚拟交换机,类似于 here .然后再次尝试像这样创建机器:

docker-machine create -d hyperv --hyperv-virtual-switch "Virtual Switch1" manager1

关于windows - Docker机器无法使用hyperv成功到达IP地址/机器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42840220/

相关文章:

docker - 确定 docker hub 上是否有新的 docker 容器可用

docker - 云运行和发布容器

operating-system - 我可以从 IP 地址获得什么信息?

windows - PowerShell 将 AD objectGUID 复制到 ms-ds-consistencyguid

windows - Microsoft Windows 的 7 POSIX 实现目前处于什么位置?

docker - 如何构建dockerfile

c# - 将 IP 转换为字节/转换回字符串

ubuntu - 没有分配给旧 Ubuntu Box 的 ip

c++ - QtSerialPort 示例失败

c - difftime 在 MinGW 中返回不正确的值