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

hyperv: The requested operation requires elevation. #7347

Closed
soumilshah1995 opened this issue Apr 1, 2020 · 5 comments
Closed

hyperv: The requested operation requires elevation. #7347

soumilshah1995 opened this issue Apr 1, 2020 · 5 comments
Labels
co/hyperv HyperV related issues kind/support Categorizes issue or PR as a support question. os/windows

Comments

@soumilshah1995
Copy link

Steps to reproduce the issue:
image

  1. i have mini kube installed and configure when i run the commands minikube start

$ minikube start

  • minikube v1.9.0 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
  • Using the hyperv driver based on existing profile

! '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

  • Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online
  •   + CategoryInfo          : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
      + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand
    
    
    

X hyperv does not appear to be installed, but is specified by an existing profile. Please run 'minikube delete' or install hyperv

@tstromberg tstromberg changed the title X Unable to get machine status: hyperv: The requested operation requires elevation. Apr 1, 2020
@tstromberg
Copy link
Contributor

Does this happen when you start Powershell as an Administrator, and run minikube from there?

@tstromberg tstromberg added co/hyperv HyperV related issues os/windows kind/support Categorizes issue or PR as a support question. labels Apr 1, 2020
@jpsalvesen
Copy link

Experiencing the same issue.

PS C:\Users\username> minikube.exe start --driver=hyperv
* minikube v1.9.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on user configuration

! 'hyperv' driver reported an issue: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Get-WindowsOptionalFeatur
e -FeatureName Microsoft-Hyper-V-All -Online failed:
Get-WindowsOptionalFeature : The requested operation requires elevation.
At line:1 char:1
+ Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand


* Suggestion: Start PowerShell as Administrator, and run: 'Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-
Hyper-V -All'
* Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/hyperv/

X hyperv does not appear to be installed

The VM is successfully created if I execute the same command in a administrative terminal.

@martin-schaefer
Copy link

I have the same issue on Windows 10 Pro when starting minikube with my normal user account:

minikube start -p k8s-showcase --cpus=2 --memory='8192mb' --disk-size='16384mb' --vm-driver=hyperv
! [k8s-showcase] minikube v1.9.2 auf Microsoft Windows 10 Enterprise 10.0.16299 Build 16299
* Using the hyperv driver based on user configuration

! 'hyperv' driver reported an issue: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online failed:
Get-WindowsOptionalFeature : Der angeforderte Vorgang erfordert erh�hte Rechte.
In Zeile:1 Zeichen:1
+ Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand


* Suggestion: Start PowerShell as Administrator, and run: 'Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All'
* Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/hyperv/

X hyperv does not appear to be installed

It seems that a normal user ist not allowed to call:

Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online

If I issue this command as an admin user in powershell, it shows me that HyperV is activated and running:

FeatureName      : Microsoft-Hyper-V-All
DisplayName      : Hyper-V
Description      : Provides services and management tools for creating and running virtual machines and their resources.
RestartRequired  : Possible
State            : Enabled
CustomProperties :

I think minikube should not make this call on startup, as it seems to require admin permissions. Or probably add a flag so this step can be skipped.

@sharifelgamal
Copy link
Collaborator

Yeah, you need to run minikube start in an elevated powershell for Hyper-V. This is a known issue.

We run Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online to ensure that Hyper-V is running, since it's the preferred driver for Windows. Knowing it's not running allows us to automatically fallback to virtualbox and/or docker.

@medyagh
Copy link
Member

medyagh commented Jul 8, 2020

Hi @soumilshah1995 I haven't heard back from you, I wonder if you still have this issue?
Regrettably, there isn't enough information in this issue to make it actionable, and a long enough duration has passed, so this issue is likely difficult to replicate.

I will close this issue for now but please feel free to reopen whenever you feel ready to provide more information.

Meanwhile have you tried out newest driver Docker Driver with latest version of minikube?
you could try
minikube delete
minikube start --driver=docker

for more information on the docker driver checkout:
https://minikube.sigs.k8s.io/docs/drivers/docker/

@medyagh medyagh closed this as completed Jul 8, 2020
This was referenced Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues kind/support Categorizes issue or PR as a support question. os/windows
Projects
None yet
Development

No branches or pull requests

6 participants