The user needs elevated privileges, and needs to be either in the admin group or the hyperv admin group.
You are free to use the following: https://github.com/code-ready/crc/tree/master/pkg/crc/preflight We added a set of Preflight checks (and possible fixes) to check if the host can run the hypervisor and start a VM, before any control is handed to libmachine. The tests are far from perfect, but for 98% of the people this works... forthe other 2%, we allow these tests to be skipped or set to warn (this could be an automated trigger, but we haven't implemented this... with a warn we TEST, but allow the start to continue).
One of the things that you have to consider here are users that are part of a domain or AD controlled machine. In that case, these checks do not work as expected. We still have to figure this out on our end... but getting there (hence the option to skip).
Looks like I ran into that same issue. What I get is this on minikube start (with hyperv set as the VM option):
````
! 'hyperv' driver reported an issue: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online failed:
Get-WindowsOptionalFeature : The requested operation requires elevation.
At line:1 char:1
X hyperv does not appear to be installed
```
I follow the suggestion to executeEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All` within an elevated PowerShell and the command succeeds but the behavior (from a user shell) is the same. And I am member of a company AD, so it seems to fit this issue.
But it seems as this option to skip pre-flight checks was removed a while ago with #2403. Or I'm just missing the switch @gbraad mentioned :)
I'm in the same situation @bjoernmartin, when I run minikube start the validation Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online Failed because I don't have permission to execute then. But the Hyper is online this command Get-WindowsOptionalFeature only works in a `run as administrator``.
I'm in contact with the AD administrator to try to solve this issue.
I use Cmder as console and I need to execute it as administrator to make this command works
minikube start --vm-driver=hyperv
If i don't, i get this message
X hyperv does not appear to be installed
I don't understand why Hyper-V Administrator group is not enough. Please remove checking if Hyper-V is installed because this command can't be executed without elevated permission.
I麓m running into the same problem. Running Get-WindowsOptionalFeatur
e -FeatureName Microsoft-Hyper-V-All -Online requires Adminstrator priveleges which my normal AD User don麓t have. But my AD User is part of Hyper-V Administrator group on my machine so running minikube won麓t be a problem or am i missing something?
Help is definitely wanted to fix this issue if anyone is game.
This was fixed by https://github.com/machine-drivers/machine/pull/24/files
However, there is still related work to make the Get-WindowsOptionalFeature check pass for non-Administrators:
Should be fixed https://github.com/kubernetes/minikube/pull/7790
Tested #7790 and i can confirm that it is working. Thanks for this contribution
Most helpful comment
Looks like I ran into that same issue. What I get is this on
minikube start(withhypervset as the VM option):````
! 'hyperv' driver reported an issue: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online failed:
Get-WindowsOptionalFeature : The requested operation requires elevation.
At line:1 char:1
~~~~~~~~~~~~~~~~~X hyperv does not appear to be installed
```
I follow the suggestion to executeEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All` within an elevated PowerShell and the command succeeds but the behavior (from a user shell) is the same. And I am member of a company AD, so it seems to fit this issue.But it seems as this option to skip pre-flight checks was removed a while ago with #2403. Or I'm just missing the switch @gbraad mentioned :)