是否可以在Windows 10和Docker上运行带有VirtualBox的Minikube?

是否可以在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 管理程序:

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]-选择完全安装 2 2)安装Virtualbox,在Docker Quickstart Terminal中运行docker run hello-world并验证是否一切正常. 3)为Windows安装 minikube (我使用了

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.