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

error provisioning host: Hyper-V PowerShell Module is not available #9040

Closed
khsabhishek opened this issue Aug 20, 2020 · 19 comments
Closed
Assignees
Labels
co/hyperv HyperV related issues kind/support Categorizes issue or PR as a support question. needs-solution-message Issues where where offering a solution for an error would be helpful triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@khsabhishek
Copy link

C:\Users\khsab>minikube start --driver=hyperv

  • minikube v1.12.3 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
  • Using the hyperv driver based on user configuration
  • Downloading VM boot image ...

    minikube-v1.12.2.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    minikube-v1.12.2.iso: 173.73 MiB / 173.73 MiB 100.00% 2.41 MiB p/s 1m12s

  • Starting control plane node minikube in cluster minikube
  • Downloading Kubernetes v1.18.3 preload ...

    preloaded-images-k8s-v5-v1.18.3-docker-overlay2-amd64.tar.lz4: 510.91 MiB

  • Creating hyperv VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
    ! StartHost failed, but will try again: creating host: create: precreate: Hyper-V PowerShell Module is not available
  • Creating hyperv VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
  • Failed to start hyperv VM. "minikube start" may fix it: creating host: create: precreate: Hyper-V PowerShell Module is not available

X error provisioning host: Failed to start host: creating host: create: precreate: Hyper-V PowerShell Module is not available
*

@tstromberg tstromberg added co/hyperv HyperV related issues needs-solution-message Issues where where offering a solution for an error would be helpful labels Aug 20, 2020
@tstromberg tstromberg changed the title error provisioning host: Failed to start host: creating host: create: precreate: Hyper-V PowerShell Module is not available error provisioning host: Hyper-V PowerShell Module is not available Aug 20, 2020
@tstromberg
Copy link
Contributor

tstromberg commented Aug 20, 2020

Could you please test to see if this command fixes your problem:

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

Then run:

minikube start --driver=hyperv -v=1 --alsologtostderr

The additional logging here will help us to see what the underlying command line is that docker-machine is attempting to execute. I found some related issues here:

Once we can confirm that the problem is fixed, I will update the error message to point directly to this solution.

@tstromberg tstromberg added triage/needs-information Indicates an issue needs more information in order to work on it. kind/support Categorizes issue or PR as a support question. labels Aug 20, 2020
@rajurh
Copy link

rajurh commented Aug 21, 2020

@tstromberg Tried with above commands no luck below is the error screenshot

image

image

@medyagh
Copy link
Member

medyagh commented Sep 16, 2020

@khsabhishek are you sure your windows supports virtualization ?

@rajurh
Copy link

rajurh commented Sep 17, 2020

@medyagh Yes it supports and was working before not sure all of a sudden its broken. I have provided my screenshots above.

@medyagh
Copy link
Member

medyagh commented Sep 30, 2020

@rajurh do you mind trying to crate a VM manuallly using hyper-v manager to see if it allows you ?

yet I would like minikube to provide a better error.
do you mind also sharing the output of the commands that enable HyperV ?

https://minikube.sigs.k8s.io/docs/drivers/hyperv/

also if you install docker, you can user our newest driver, docker driver.

minikube delete --all
minikube start --driver=docker

@rajurh
Copy link

rajurh commented Oct 1, 2020

@medyagh No luck, with docker driver we have limitations like ingress controller addons, etc.

@medyagh
Copy link
Member

medyagh commented Oct 28, 2020

@rajurh I wonder if you still have this issue, to me it sounds like there is something about your hyperv installation,

do you mind sharing your hperv virtual switch by clicking on the hyperv manager ? and see if you can create a new virtual switch and pass it to minikube using the flag

 --hyperv-virtual-switch='': The hyperv virtual switch name. Defaults to first found. (hyperv driver only)

@rajurh
Copy link

rajurh commented Oct 28, 2020

@medyagh Thanks for checking - Yes issue still exists. I tried creating a new switch as shown in the below screenshot and referencing in minikube command no luck still the same error

image

image

@medyagh
Copy link
Member

medyagh commented Nov 11, 2020

the error message seems to be hyperv not configured correctly.

@medyagh
Copy link
Member

medyagh commented Dec 2, 2020

@khsabhishek do you have this problem, I wonder if you have tried our docker driver?
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
Copy link
Member

medyagh commented Jan 27, 2021

Regrettably @khsabhishek , 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. If you can provide any additional details, such as:

@medyagh medyagh closed this as completed Jan 27, 2021
@jannette-wang
Copy link

minikube start
minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.

All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away: minikube start

Installing...

😄 minikube v1.25.2 on Microsoft Windows 10 Enterprise 10.0.19042 Build 19042
✨ Automatically selected the hyperv driver
💿 Downloading VM boot image ...
> minikube-v1.25.2.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
> minikube-v1.25.2.iso: 237.06 MiB / 237.06 MiB [] 100.00% 8.65 MiB p/s 28s
👍 Starting control plane node minikube in cluster minikube
💾 Downloading Kubernetes v1.23.3 preload ...
> preloaded-images-k8s-v17-v1...: 505.68 MiB / 505.68 MiB 100.00% 9.85 MiB
🔥 Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🤦 StartHost failed, but will try again: creating host: create: precreate: Hyper-V PowerShell Module is not available
🔥 Creating hyperv VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
😿 Failed to start hyperv VM. Running "minikube delete" may fix it: creating host: create: precreate: Hyper-V PowerShell Module is not available

❌ Exiting due to PR_HYPERV_MODULE_NOT_INSTALLED: Failed to start host: creating host: create: precreate: Hyper-V PowerShell Module is not available
💡 Suggestion: Run: 'Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Tools-All'
📘 Documentation: https://www.altaro.com/hyper-v/install-hyper-v-powershell-module/
🍿 Related issue: #9040

@hrshlmeht
Copy link

How do I check whether my Hyper-V is working properly or not?

@hrshlmeht
Copy link

I am getting the exact same error while installing creating a minikube also I see not Hyper-V manger in my system. (I am using windows 11)

@rjdudley
Copy link

If you're running Windows, make sure you are not using Home. Home does not support the Hyper-V components necessary. You need Pro or higher.

@david3a
Copy link

david3a commented Sep 23, 2023

just run into this, windows home is my issue I assume, guess using minikube is not possible or is likely this can be handled ina future release?

@rjdudley
Copy link

just run into this, windows home is my issue I assume, guess using minikube is not possible or is likely this can be handled ina future release?

A few years ago there was a preview in a Windows Insider build running kubernetes on Home, but I'm not sure what happened to it. There are a number of options for local kubernetes, I'm not sure if any of them can fake a hypervisor or not. Most documentation doesn't discern the different editions of Windows so it's hard to tell until things don't work.

@david3a
Copy link

david3a commented Sep 24, 2023

hyper=v is fine, docker and podman run fine so not sure what is missing

@git-chinmay
Copy link

Container on windows sucks!!!

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. needs-solution-message Issues where where offering a solution for an error would be helpful triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

9 participants