是否可以在 Windows 10 和 Docker 上使用 VirtualBox 运行 Minikube?
我想在 Windows 10 上使用 minikube.我已经安装了 VirtualBox 并想将其用作 minikube 的虚拟机.我还为 Windows 安装了 Docker.但是在安装过程中 Docker 强制默认使用 Hyper-V.但这意味着我不能再使用 VirtualBox 来运行 minikube!不知道我在这里错过了什么.
I want to use minikube on Windows 10. I have installed VirtualBox and want to use it as the virtual machine for minikube. Also I installed Docker for windows. But during installation Docker forced to use Hyper-V as default. But that means I can no longer use VirtualBox to run minikube! Not sure what am I missing here.
我在 Mac 上使用过 minikube,它更简单:只需打开 VirtualBox,然后在命令行上运行命令:minikube start
.然而,在 Windows 10 中,它似乎要复杂得多.
I have used minikube on Mac and there it was much simpler: simply open VirtualBox and then run command on command line: minikube start
. However in Windows 10 it seems much more complicated.
澄清一下:Docker 需要开启 Hyper-V,而 Virtualbox 需要关闭 Hyper-V.原因是他们使用不同的虚拟化技术,确切地说 - 类型 1 和类型 2 hypervisors一个>:
Just to make things clear: Docker requires Hyper-V to be turned on, and Virtualbox requires Hyper-V to be turned off. The reason is they use different virtualization technologies, to be exact - type 1 and type 2 hypervisors:
类型 1 管理程序:管理程序直接在系统硬件上运行 - A裸机"嵌入式管理程序,类型 2 管理程序:管理程序运行在提供虚拟化服务的主机操作系统上,例如作为 I/O 设备支持和内存管理.
Type 1 hypervisor: hypervisors run directly on the system hardware – A "bare metal" embedded hypervisor, Type 2 hypervisor: hypervisors run on a host operating system that provides virtualization services, such as I/O device support and memory management.
我发现解决这个问题的方法很少.其中之一是添加另一个引导选项并在每次需要在虚拟机管理程序之间切换时重新启动,但这种方法似乎与手动关闭 Hyper-V、重新启动然后在 VirtualBox 中使用 minikube 一样好.这可能不是理想的状态.
I've found that there are few approaches to this issue. One of them is adding another boot option and rebooting every time you needed to switch between hypervisors, but it seems that this method is as good as manually turning off Hyper-V, restarting and then using your minikube in VirtualBox. This is probably not the desired state.
因此您不能立即使用它们,您将不得不使用 Docker 为旧 Windows 系统引入的工具.这是因为 Docker Toolbox 没有使用 Hyper-V.
So as you can't use them at once, you will have to use a tool that was introduced by Docker for older Windows systems. This is because Docker Toolbox is not using Hyper-V.
请把这个解决方案当成一种解决方法,如果可以使用Docker,即使是Docker也不推荐使用Docker工具箱.此外,您可以使用在 Hyper-V 上运行的 minikube 获得相同的结果.
0) 卸载 Docker,关闭 Hyper-V,删除 minikube 的所有痕迹,卸载 VirtualBox(如果您之前尝试运行它.)1) 安装[Docker Toolbox] - 选择完全安装22) 安装 Virtualbox,在 Docker 快速入门终端内运行 docker run hello-world
并验证是否一切正常.3) 为 Windows 安装 minikube(我使用了 巧克力)4) 运行minikube start
.
0) Uninstall Docker, turn off Hyper-V, delete all traces of minikube, uninstall VirtualBox (if you tried to run it previously.)
1) Install [Docker Toolbox] - choose full installation2
2) Install Virtualbox, run docker run hello-world
inside of Docker Quickstart Terminal and verify if everything is working correctly.
3) Install minikube for Windows (I used chocolatey)
4) Run minikube start
.
我已经测试了这些步骤,并且能够在 Docker 工具箱中运行 Docker 容器,同时在 minikube 中初始化 Kubernetes 集群.
I've tested this steps, and I was able to run Docker containers in the Docker toolbox in the meantime initializing a Kubernetes cluster in minikube.