Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM_BOOT_FAILED_HYPERV_ENABLED message should mention --driver=hyperv as a solution #4783

Closed
ivankatashkova opened this issue Jul 17, 2019 · 12 comments
Assignees
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. os/windows priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@ivankatashkova
Copy link

I'm following a tutorial from kubernetes.io to install Kubernetes with minikube for Windows. The first time I executed minikube start I got the missing VirtualBox issue, but I actually want to use Hyper-V. After installing VirtualBox, now I get the other known issue with Hyper-V. Please find more information below.
The exact command to reproduce the issue:
minikube start

The full output of the command that failed:


$ minikube start

  • minikube v1.2.0 on windows (amd64)
  • Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
    E0717 13:02:10.679444 20092 start.go:559] StartHost: create: precreate: This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when Hyper-V is activated. Either use Hyper-V as a driver, or disable the Hyper-V hypervisor. (To skip this check, use --virtualbox-no-vtx-check)

X Unable to start VM

The output of the minikube logs command:

The operating system version:
minikube version: v1.2.0
Windows 10 Enterprise

@afbjorklund
Copy link
Collaborator

Try minikube start --vm-driver=hyperv instead.

@afbjorklund afbjorklund added os/windows kind/support Categorizes issue or PR as a support question. labels Jul 17, 2019
@ivankatashkova
Copy link
Author

Thank you for your answer!
Now I get this error:
$ minikube start --vm-driver=hyperv

  • minikube v1.2.0 on windows (amd64)
  • Creating hyperv VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
    panic: runtime error: index out of range

goroutine 1 [running]:
github.com/docker/machine/drivers/hyperv.hypervAvailable(0xc000748de0, 0xc0007f6810)
/go/pkg/mod/github.com/docker/machine@v0.16.1/drivers/hyperv/powershell.go:64 +0x101
github.com/docker/machine/drivers/hyperv.(*Driver).PreCreateCheck(0xc0004ce1e0, 0x0, 0x0)
/go/pkg/mod/github.com/docker/machine@v0.16.1/drivers/hyperv/hyperv.go:168 +0x3b
k8s.io/minikube/pkg/minikube/machine.(*LocalClient).Create(0xc000352bc0, 0xc0004ce240, 0xc0004c48d0, 0x0)
/app/pkg/minikube/machine/client.go:211 +0x36b
k8s.io/minikube/pkg/minikube/cluster.createHost(0x1744440, 0xc000352bc0, 0x0, 0xc0000ad840, 0x3f, 0x800, 0x2, 0x4e20, 0xc00009014c, 0x6, ...)
/app/pkg/minikube/cluster/cluster.go:373 +0x613
k8s.io/minikube/pkg/minikube/cluster.StartHost(0x1744440, 0xc000352bc0, 0x0, 0xc0000ad840, 0x3f, 0x800, 0x2, 0x4e20, 0xc00009014c, 0x6, ...)
/app/pkg/minikube/cluster/cluster.go:92 +0x102d
k8s.io/minikube/cmd/minikube/cmd.startHost.func1(0xc00074ea50, 0x30)
/app/cmd/minikube/cmd/start.go:557 +0x9a
k8s.io/minikube/pkg/util.RetryAfter(0x3, 0xc00074ea50, 0x77359400, 0x888c00, 0x0)
/app/pkg/util/utils.go:117 +0x99
k8s.io/minikube/cmd/minikube/cmd.startHost(0x1744440, 0xc000352bc0, 0x0, 0xc0000ad840, 0x3f, 0x800, 0x2, 0x4e20, 0xc00009014c, 0x6, ...)
/app/cmd/minikube/cmd/start.go:563 +0x134
k8s.io/minikube/cmd/minikube/cmd.runStart(0x2284020, 0xc00032ae80, 0x0, 0x1)
/app/cmd/minikube/cmd/start.go:236 +0x4ef
github.com/spf13/cobra.(*Command).execute(0x2284020, 0xc00032ae60, 0x1, 0x1, 0x2284020, 0xc00032ae60)
/go/pkg/mod/github.com/spf13/cobra@v0.0.0-20180228053838-6644d46b81fa/command.go:757 +0x2b5
github.com/spf13/cobra.(*Command).ExecuteC(0x2283440, 0x1, 0x12fe1a0, 0xc000037ec8)
/go/pkg/mod/github.com/spf13/cobra@v0.0.0-20180228053838-6644d46b81fa/command.go:843 +0x2f3
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/cobra@v0.0.0-20180228053838-6644d46b81fa/command.go:791
k8s.io/minikube/cmd/minikube/cmd.Execute()
/app/cmd/minikube/cmd/root.go:103 +0x35
main.main()
/app/cmd/minikube/main.go:51 +0xdb

@afbjorklund afbjorklund added the co/hyperv HyperV related issues label Jul 17, 2019
@afbjorklund
Copy link
Collaborator

Ouch. Yeah, I suppose that's a bug in the hyperv driver :-(

Trying to run this PowerShell command:

@(Get-Module -ListAvailable hyper-v).Name | Get-Unique

But apparently doesn't like the response.

Hopefully someone that knows Windows is able to help out...

@afbjorklund afbjorklund removed the kind/support Categorizes issue or PR as a support question. label Jul 17, 2019
@ivankatashkova
Copy link
Author

In case someone is blocked by the same problem I found a solution. You should run the command in Windows Power Shell with administrator rights. Also, you should configure Virtual Switch to your Hyper-V following this steps. And after that you will be able to execute minikube start by specifying the Virtual Switch: minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch". But I still have problems. So I wonder am I doing something wrong ? Why is this so hard? 😥

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jul 17, 2019

We will have a check for this in the future (administrator for hyperv) Previously Hyper-V (in Minikube) has suffered from a lack of tests and shortage of Windows developers...

Reference: "hyperv: Assert that the user has correct permissions" #4745

@lewijw
Copy link

lewijw commented Jul 17, 2019

Thanks Ivanka. Your solution was extremely helpful. As a result, I got through this tutorial: https://kubernetes.io/docs/tutorials/hello-minikube

Except for this:
PS C:\WINDOWS\system32> minikube addons disable heapster

X disable failed: [disabling addon deploy/addons/heapster/influx-grafana-rc.yaml.tmpl: Process exited with status 1]

Also minikube stop seems to hang now.

@tstromberg tstromberg added the needs-solution-message Issues where where offering a solution for an error would be helpful label Jul 17, 2019
@tstromberg tstromberg changed the title Issues while trying to start minikube VM_BOOT_FAILED_HYPERV_ENABLED message should mention --driver=hyperv as a solution Jul 17, 2019
@tstromberg tstromberg added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 17, 2019
@tstromberg
Copy link
Contributor

While this issue is a good collection of friction points for Hyper-V usage, the path toward resolving the first item would be improving the string here:

"VM_BOOT_FAILED_HYPERV_ENABLED": {

It should also point to documentation for setting up minikube & HyperV. If you have a suggested way of wording this to help users, I'd be eager to review a PR that makes it happen. Help wanted!

@tstromberg tstromberg added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jul 17, 2019
@blueelvis
Copy link
Contributor

blueelvis commented Jul 21, 2019

@ivankatashkova - Thanks for reporting the issue! Could you please tell us more about the issues you are facing after starting minikube on Hyper-V? Is the initial issue resolved or is Minikube still not starting?

@tstromberg - I think we should have a section on that documentation regarding Windows. This issue is happening because by default, the driver which is passed (when minikube is started only using minikube start) is Virtualbox even on Windows.

startCmd.Flags().String(vmDriver, constants.DefaultVMDriver, fmt.Sprintf("VM driver is one of: %v", constants.SupportedVMDrivers))

const DriverVirtualbox = "virtualbox"

I can think of the following 2 ways -

  1. We keep it like that but add documentation to the initial minikube tutorial about how to get going with Hyper-V initially.
  2. We add logic to our code to detect the available drivers on the machine and then use them accordingly. I think this option would be best in the long term.

What do you think?

@ivankatashkova
Copy link
Author

Hi, everyone!

After resolving this issue I was blocked by hanging process on Waiting for SSH access ...
I'm not sure how I resolved this after trying some things from other Github issues, but the process has finally succeeded.
For me, it would be easier if there is a documentation on how to set up minikube using VirtualBox and how - using Hyper-V. I would be happy to help with this documentation!

Thanks and best regards,
Ivanka

@blueelvis
Copy link
Contributor

@lewijw - Thanks for reporting the issue ! I have created a new issue (#4848) for this and I am also able to reproduce this on my machine.

@ivankatashkova - Glad to hear that the issue got resolved! I have created an issue (#4846) to add the documentation for both Hyper-V and Virtualbox setup with minikube on Windows. Feel free to take a stab at it :)

-Pranav

@tstromberg tstromberg added this to the v1.4.0 milestone Sep 16, 2019
@tstromberg tstromberg self-assigned this Sep 16, 2019
@tstromberg tstromberg removed the needs-solution-message Issues where where offering a solution for an error would be helpful label Dec 19, 2019
@hh186011
Copy link

hh186011 commented Aug 3, 2021

Hi all
I had the same problem, the solution ...
run:
minikube delete
minikube start --vm-driver hyperv

and the problem was solved.
kube

@michelsampil
Copy link

Same as @hh186011, just run as admin:

-minikube delete
-minikube start --vm-driver hyperv

It solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. os/windows priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

7 participants