首页 > 解决方案 > 在 Windows 10 上安装 Kubernetes

问题描述

我正在按照此页面上的说明(https://kubernetes.io/docs/tasks/tools/install-minikube/)在 Windows 10 上安装 kubernetes。我已经在我的系统上启用了虚拟化并安装了 virtualbox。当我尝试启动 minikube 时,它​​失败并出现以下错误:

>minikube start
* minikube v1.9.2 on Microsoft Windows 10 Home 10.0.18362 Build 18362
* Using the virtualbox driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Creating virtualbox VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
! StartHost failed, but will try again: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
* Creating virtualbox VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
*
* [VBOX_VTX_DISABLED] Failed to start virtualbox VM. "minikube start" may fix it. creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
* Suggestion: Virtualization support is disabled on your computer. If you are running minikube within a VM, try '--driver=docker'. Otherwise, consult your systems BIOS manual for how to enable virtualization.
* Related issues:
  - https://github.com/kubernetes/minikube/issues/3900
  - https://github.com/kubernetes/minikube/issues/4730

这是我从命令提示符执行 systeminfo 时得到的:

 [03]: VirtualBox Host-Only Ethernet Adapter
                                 Connection Name: VirtualBox Host-Only Network
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: ***.***.**.*
                                 [02]: ****::****:****:****:****
                           [04]: VirtualBox Host-Only Ethernet Adapter
                                 Connection Name: VirtualBox Host-Only Network #2
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: ***.***.**.*
                                 [02]: ****::****:****:****:****
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

有谁知道如何解决这一问题?

谢谢

标签: kubernetes

解决方案


[VBOX_VTX_DISABLED] 表示 BIOS 中未启用虚拟化或 Hyper-V 正在运行且不允许访问 VMX。

假设您已启用虚拟化,则值得检查第二个选项并尝试禁用 Hyper-V。

您可以通过在 powershell 中使用此命令来做到这一点:

  `bcdedit /set hypervisorlaunchtype off`

您可能还想禁用这两个功能:

Virtual Machine Platform两者Windows Subsystem for Linux 都可以在Turn Windows Features on/off

另请注意,Microsoft 不断添加启用 hyper-v 并阻止 virtualbox 使用 vtx 的功能。根据系统版本,您的系统中可能缺少其中一些,但值得检查并禁用它们。

  • 应用程序防护
  • 凭据保护
  • 设备卫士
  • 容器
  • 超V
  • 虚拟机平台
  • Windows 管理程序平台
  • Windows 沙盒
  • Windows 服务器容器
  • 适用于 Linux 2 (WSL2) 的 Windows 子系统

记得做冷启动(关机10秒再开机)


推荐阅读