以管理员身份运行时,minikube 中的“Hyper-v 命令必须以管理员身份运行”

Rod*_*eas 3 powershell windows-10 minikube

Windows 10 企业版。我正在尝试设置 minikube 并遵循官方文档。当我尝试确认安装时,使用以下命令:

minikube start --driver=hyperv
Run Code Online (Sandbox Code Playgroud)

然后我得到这个错误:

X Exiting due to PR_HYPERV_AS_ADMIN: Failed to start host: creating host: create: precreate: Hyper-v commands have to be run as an Administrator
* Suggestion: Right-click the PowerShell icon and select Run as Administrator to open PowerShell in elevated mode.
* Documentation: https://rominirani.com/docker-machine-windows-10-hyper-v-troubleshooting-tips-367c1ea73c24
* Related issue: https://github.com/kubernetes/minikube/issues/4511
Run Code Online (Sandbox Code Playgroud)

但是,我以管理员身份运行 Powershell (开始菜单 > 右键单击​​ Powershell 图标 > 选择“以管理员身份运行”。)我还尝试以管理员身份运行常规 cmd 实例——同样的问题。不幸的是,消息中的“文档”页面是 404,并且“相关问题”已关闭,没有任何有用的信息。

如何向我的 Powershell 或 cmd 实例应用适当的管理员权限,以便能够将 minikube 与 Hyper-V 结合使用?这个另一个问题证实我确实需要以管理员身份运行,但似乎即使以管理员身份运行也不足以完成 minikube 在幕后进行的任何检查。

(需要注意的是,我能够使用 docker 驱动程序启动它,但我对本地 docker 做了一些可怕的事情,并且更喜欢使用 Hyper-V。)

  • minikube v1.13.1

Aar*_*ron 6

对于任何未来的搜索者,我在更新到 Windows 10 后遇到了同样的问题。我还以管理员身份运行 Powershell,但仍然看到此错误。

> minikube start --memory 3072 --cpus=2
* minikube v1.23.2 on Microsoft Windows 10 Pro 10.0.19042 Build 19042
* Using the hyperv driver based on existing profile

X Exiting due to PROVIDER_HYPERV_NOT_RUNNING
Run Code Online (Sandbox Code Playgroud)

请尝试将您的用户添加到 Hyper-V 管理员组

这 ^ 是我的解决方案。基本上,我做了以下事情:

  • 右键单击“此电脑”并选择“管理”。
  • 在“本地用户和组”->“用户”中找到了我的用户。
  • 打开我的用户属性。
  • 在“成员”选项卡上,我单击“添加”并输入“hyper-v 管理员”。
  • “检查姓名”确保我拼写正确。

之后,我的minikube start工作按预期进行。