minikube: hypervAvailable: panic: runtime error: index out of range [0] with length 0
I am unable to start minikube on windows 10.
Please provide the following details:
Environment:
Minikube version (use minikube version): v0.25.2
- OS (e.g. from /etc/os-release): windows 10
- VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyper-v - ISO version (e.g.
cat ~/.minikube/machines/minikube/config.json | grep -i ISOorminikube ssh cat /etc/VERSION): minikube-v0.25.1.iso - Install tools:
- Others:
What happened: minikube is unable to start on windows 10.
What you expected to happen: minikube should be able to create vm and create a cluster.
How to reproduce it (as minimally and precisely as possible): minikube start --vm-driver hyperv --hyperv-virtual-switch “mini” --alsologtostderr -v 9999
Output of minikube logs (if applicable):
I0702 13:00:36.012545 6380 start.go:96] Viper configuration: Aliases: map[string]string{} Override: map[string]interface {}{“v”:“9999”, “alsologtostderr”:“true”} PFlags: map[string]viper.FlagValue{“apiserver-ips”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa140)}, “apiserver-name”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa000)}, “container-runtime”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa460)}, “registry-mirror”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa320)}, “vm-driver”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617860)}, “mount”:viper.pflagValue{flag:(*pflag.Flag)(0xc0426175e0)}, “cache-images”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa640)}, “feature-gates”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa5a0)}, “host-only-cidr”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617ae0)}, “kvm-network”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617c20)}, “iso-url”:viper.pflagValue{flag:(*pflag.Flag)(0xc0426177c0)}, “nfs-share”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617d60)}, “nfs-shares-root”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617e00)}, “profile”:viper.pflagValue{flag:(*pflag.Flag)(0xc042616b40)}, “disable-driver-mounts”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617720)}, “docker-opt”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617f40)}, “insecure-registry”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa280)}, “mount-string”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617680)}, “xhyve-disk-driver”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617cc0)}, “apiserver-names”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa0a0)}, “disk-size”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617a40)}, “dns-domain”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa1e0)}, “keep-context”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617540)}, “memory”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617900)}, “docker-env”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617ea0)}, “extra-config”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa6e0)}, “kubernetes-version”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa3c0)}, “bootstrapper”:viper.pflagValue{flag:(*pflag.Flag)(0xc042616be0)}, “cpus”:viper.pflagValue{flag:(*pflag.Flag)(0xc0426179a0)}, “hyperv-virtual-switch”:viper.pflagValue{flag:(*pflag.Flag)(0xc042617b80)}, “network-plugin”:viper.pflagValue{flag:(*pflag.Flag)(0xc0425fa500)}} Env: map[string]string{} Key/Value Store: map[string]interface {}{} Config: map[string]interface {}{} Defaults: map[string]interface {}{“reminderwaitperiodinhours”:24, “wantreporterror”:false, “wantkubectldownloadmsg”:true, “wantnonedriverwarning”:true, “v”:“0”, “wantupdatenotification”:true, “showdriverdeprecationnotification”:true, “alsologtostderr”:“false”, “log_dir”:“”, “wantreporterrorprompt”:true} I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: gcr.io/k8s-minikube/storage-provisioner:v1.8.0 at C:\Users\dekumar.minikube\cache\images\gcr.io\k8s-minikube\storage-provisioner_v1.8.0 Starting local Kubernetes v1.9.4 cluster… Starting VM… I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.5 at C:\Users\dekumar.minikube\cache\images\k8s.gcr.io\k8s-dns-dnsmasq-nanny-amd64_1.14.5 I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: gcr.io/google-containers/kube-addon-manager:v6.5 at C:\Users\dekumar.minikube\cache\images\gcr.io\google-containers\kube-addon-manager_v6.5 I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.1 at C:\Users\dekumar.minikube\cache\images\k8s.gcr.io\kubernetes-dashboard-amd64_v1.8.1 I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.5 at C:\Users\dekumar.minikube\cache\images\k8s.gcr.io\k8s-dns-sidecar-amd64_1.14.5 I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.5 at C:\Users\dekumar.minikube\cache\images\k8s.gcr.io\k8s-dns-kube-dns-amd64_1.14.5 I0702 13:00:36.015518 6380 cache_images.go:292] Attempting to cache image: k8s.gcr.io/pause-amd64:3.0 at C:\Users\dekumar.minikube\cache\images\k8s.gcr.io\pause-amd64_3.0 I0702 13:00:36.016537 6380 cluster.go:70] Machine does not exist… provisioning new machine I0702 13:00:36.023535 6380 cache_images.go:79] Successfully cached all images. I0702 13:00:36.023535 6380 cluster.go:71] Provisioning machine with config: {MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v0.25.1.iso Memory:2048 CPUs:2 DiskSize:20000 VMDriver:hyperv XhyveDiskDriver:ahci-hd DockerEnv:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.99.1/24 HypervVirtualSwitch:mini KvmNetwork:default Downloader:{} DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID:} I0702 13:00:36.028542 6380 downloader.go:56] Not caching ISO, using https://storage.googleapis.com/minikube/iso/minikube-v0.25.1.iso Reading certificate data from C:\Users\dekumar.minikube\certs\ca.pem Decoding PEM data… Parsing certificate… Reading certificate data from C:\Users\dekumar.minikube\certs\cert.pem Decoding PEM data… Parsing certificate… [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique [stdout =====>] : [stderr =====>] : panic: runtime error: index out of range
goroutine 1 [running]: k8s.io/minikube/vendor/github.com/docker/machine/drivers/hyperv.hypervAvailable(0xc0424ae0f0, 0xc0000000cb) /go/src/k8s.io/minikube/vendor/github.com/docker/machine/drivers/hyperv/powershell.go:64 +0x11b k8s.io/minikube/vendor/github.com/docker/machine/drivers/hyperv.(*Driver).PreCreateCheck(0xc0423a2240, 0x0, 0x0) /go/src/k8s.io/minikube/vendor/github.com/docker/machine/drivers/hyperv/hyperv.go:159 +0x3d k8s.io/minikube/vendor/github.com/docker/machine/libmachine/drivers.(Driver).PreCreateCheck-fm(0x0, 0x0) /go/src/k8s.io/minikube/pkg/minikube/machine/client.go:192 +0x39 k8s.io/minikube/pkg/minikube/machine.(*LocalClient).Create(0xc0420561c0, 0xc0423a22a0, 0x0, 0x0) /go/src/k8s.io/minikube/pkg/minikube/machine/client.go:226 +0x314 k8s.io/minikube/pkg/minikube/cluster.createHost(0x1dd2600, 0xc0420561c0, 0xc0424700c0, 0x40, 0x800, 0x2, 0x4e20, 0xc0420100e8, 0x6, 0x14eef8f, …) /go/src/k8s.io/minikube/pkg/minikube/cluster/cluster.go:252 +0x519 k8s.io/minikube/pkg/minikube/cluster.StartHost(0x1dd2600, 0xc0420561c0, 0xc0424700c0, 0x40, 0x800, 0x2, 0x4e20, 0xc0420100e8, 0x6, 0x14eef8f, …) /go/src/k8s.io/minikube/pkg/minikube/cluster/cluster.go:72 +0x6e0 k8s.io/minikube/cmd/minikube/cmd.runStart.func1(0xf, 0x1e69ce0) /go/src/k8s.io/minikube/cmd/minikube/cmd/start.go:157 +0x83 k8s.io/minikube/pkg/util.RetryAfter(0x5, 0xc042244c00, 0x77359400, 0xf, 0x0) /go/src/k8s.io/minikube/pkg/util/utils.go:101 +0x83 k8s.io/minikube/cmd/minikube/cmd.runStart(0x1e539a0, 0xc042602150, 0x0, 0x7) /go/src/k8s.io/minikube/cmd/minikube/cmd/start.go:163 +0xa04 k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).execute(0x1e539a0, 0xc042615f80, 0x7, 0x7, 0x1e539a0, 0xc042615f80) /go/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:603 +0x23b k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1e52f00, 0x0, 0x1e89800, 0xc04256df30) /go/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:689 +0x305 k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).Execute(0x1e52f00, 0x0, 0x0) /go/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:648 +0x32 k8s.io/minikube/cmd/minikube/cmd.Execute() /go/src/k8s.io/minikube/cmd/minikube/cmd/root.go:105 +0x34 main.main() /go/src/k8s.io/minikube/cmd/minikube/main.go:41 +0xa0 Anything else do we need to know: after noticing the logs as highlighted i ran the shell commands as below
PS C:\WINDOWS\system32> Get-Module -ListAvailable hyper-v
Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
ModuleType Version Name ExportedCommands
Binary 2.0.0.0 Hyper-V {Add-VMAssignableDevice, Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMGpuPartitionAdapter…} Binary 1.1 Hyper-V {Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMHardDiskDrive, Add-VMMigrationNetwork…}
PS C:\WINDOWS\system32> (Get-Module -ListAvailable hyper-v).Name | Get-Unique Hyper-V PS C:\WINDOWS\system32>
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 19 (2 by maintainers)
I might be a little late or this may be unrelated, but I had the same output and after deleting the folder .minikube from my home directory and reran minikube start, this resolved my issues with hyperv.
After facing similar issues, I managed to get it working by making sure I had all the Hyper-V ‘Windows features’ installed. Specially the PowerShell module, which was not at first.
Thanks @DuaneNielsen
Executing the following steps worked for me:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -Allminikube start --vm-driver "hyperv" --hyperv-virtual-switch "Minikube"Please note that after fixing this issue, I ran into the following problem:
I suspect in my case… what minikube meant to say was. “HyperV Not found”
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -AllShould resolve it…