无法在Windows 10上使用Hyper-V启动minikube

时间:2019-04-28 10:21:21

标签: kubernetes hyper-v minikube

即使虚拟交换机可用,minikube也不会以“找不到vswitch”错误开头

操作系统: Windows 10 管理程序:Hyper-V Minikube版本: v1.0.0

可用的虚拟交换机:

PS C:\WINDOWS\system32> Get-VMSwitch

Name           SwitchType NetAdapterInterfaceDescription
----           ---------- ------------------------------
DockerNAT      Internal
MinikubeVS     External   Intel(R) Dual Band Wireless-AC 7265
Default Switch Internal

错误:

λ minikube start --vm-driver hyperv --hyperv-virtual-switch "MinikubeVS" --v 99
o   minikube v1.0.0 on windows (amd64)
$   Downloading Kubernetes v1.14.0 images in the background ...
>   Creating hyperv VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
@   Downloading Minikube ISO ...
 142.88 MB / 142.88 MB [============================================] 100.00% 0s
Creating CA: C:\Users\sudhi\.minikube\certs\ca.pem
Creating client certificate: C:\Users\sudhi\.minikube\certs\cert.pem
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique
[stdout =====>] : Hyper-V

[stderr =====>] :
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578")
[stdout =====>] : False

[stderr =====>] :
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
[stdout =====>] : True

[stderr =====>] :
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive [Console]::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\Get-VMSwitch).Name
[stdout =====>] :
[stderr =====>] : Hyper-V\Get-VMSwitch : The operation on computer 'LAPTOP-CLH1EQAJ' failed: The specified service does not exist as an installed service.
At line:1 char:53
+ ... ::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\Get-VMSwitch).Name
+                                                ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VMSwitch], VirtualizationException
    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.GetVMSwitch



!   Unable to start VM: create: precreate: vswitch "MinikubeVS" not found

*   Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
-   https://github.com/kubernetes/minikube/issues/new

1 个答案:

答案 0 :(得分:0)

有几次类似的情况。尤其是在创建/删除/重用hyperv-virtual-switch之后。

我建议您删除C:\Users\%USERNAME%\.minikube,然后再次尝试启动minikube。

这在很多情况下都有帮助。