Heads up: I need Hyper-V as VM driver because I want to be able to use the ingress addon; using Docker as the driver will not allow the use of addons in Windows.
I am using Minikube v1.11.0 and Kubernetes v1.18.3. When I am trying to create and launch a Minikube cluster according to this tutorial with Hyper-V in PowerShell it keeps hanging on 'Creating hyperv VM:
PS C:\WINDOWS\system32> minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
* minikube v1.11.0 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
- KUBECONFIG=~/.kube/config
* Using the hyperv driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Creating hyperv VM (CPUs=4, Memory=4096MB, Disk=20000MB) ...
After about 10 minutes it goes further and crashes with this errors:
* Stopping "minikube" in hyperv ...
* Powering off "minikube" via SSH ...
* Deleting "minikube" in hyperv ...
! StartHost failed, but will try again: creating host: create host timed out in 240.000000 seconds
E0605 19:02:43.905739 30748 main.go:106] libmachine: [stderr =====>] : Hyper-V\Get-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (minikube:String) [Get-VM], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
...
Multiple E0605 errors
...
* Failed to start hyperv VM. "minikube start" may fix it: creating host: create host timed out in 240.000000 seconds
*
* [CREATE_TIMEOUT] error provisioning host Failed to start host: creating host: create host timed out in 240.000000 seconds
* Suggestion: Try 'minikube delete', and disable any conflicting VPN or firewall software
* Related issue: https://github.com/kubernetes/minikube/issues/7072
What to do?
According to the tutorial you followed you have to make a new virtual network switch in the Hyper-V Manager with the type External. The author does not explain why the network switch has to be external, other than that this configuration is best for avoiding headaches with Minikube not working properly with other software.
For some reason the External type of the virtual network switch was the problem, instead of External type use the Internal type for your virtual network switch in the Hyper-V Manager. Then run the following command to delete the wrong configurated cluster and to clean up:
minikube delete
Now, re-run the create/launch command for your Minikube cluster with your internal virtual network switch:
minikube start --vm-driver hyperv --hyperv-virtual-switch "Your Internal Virtual Switch"
Now you're all set with your new cluster when it finishes correctly!
Fix On Azure VM in Windows Server 2019:
Check if minikube VM has an IP Address in Networking tab
If NO IP address and no DHCP is running in VM, then go to next step
Create new InternalNAT switch:
Powershell:
New-VMSwitch -Name "InternalNAT" -SwitchType Internal
Get-NetAdapter
# Take note of the "ifIndex" for the virtual switch you just created, assuming 13
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 13
New-NetNat -Name "InternalNat" -InternalIPInterfaceAddressPrefix 192.168.0.0/24
Create DHCP Server
Create new scope for 192.168.. (or any range, note down this range)
Delete and Re-create minikube and use "InternalNat" switch
minikube start --vm-driver hyperv --hyperv-virtual-switch "InternalNAT"
Use minikube start --hyperv-use-external-switch instead!
Related
I am trying to create the minikube cluster, but It always fails.
Any suggestions are very welcome:
C:\WINDOWS\system32>minikube start --driver=vmware
minikube v1.16.0 on Microsoft Windows 10 Home 10.0.19042 Build 19042
Using the vmware driver based on user configuration
Starting control plane node minikube in cluster minikube
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Deleting "minikube" in vmware ...
! StartHost failed, but will try again: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Failed to start vmware VM. Running "minikube delete" may fix it: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
X Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Suggestion: Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --driver=none
Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/
Related issues:
https://github.com/kubernetes/minikube/issues/4249
https://github.com/kubernetes/minikube/issues/3566
I had a similar error when setting up Minikube on Mac OS.
When I run the command minikube start I get the error below:
😄 minikube v1.22.0 on Darwin 11.4
✨ Using the vmware driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🏃 Updating the running vmware "minikube" VM ...
🤦 StartHost failed, but will try again: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
🏃 Updating the running vmware "minikube" VM ...
😿 Failed to start vmware VM. Running "minikube delete" may fix it: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
❌ Exiting due to GUEST_PROVISION: Failed to start host: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
The issue was caused by an interruption when I was creating the VMWare VM for Minikube.
I tried fixing it by deleting the existing minikube vm and creating another one using:
minikube delete
minikube start
But then I ran into another issue this time:
Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting.
Here's how I fixed it
After multiple research, it's just best to set up minikube with docker driver which will save you all this hassle.
For Mac OS:
If you already have docker installed or docker-compose simply uninstall it using:
brew uninstall docker
brew uninstall docker-compose
Next, install Docker desktop. This will install Docker/Docker Desktop, Docker-compose and other dependencies using:
brew install --cask docker
Next, start the docker engine by opening the Docker application. Afterwhich you can confirm the docker version using:
docker --version
Finally, setup minikube using docker driver:
minikube start --driver=docker
When I am not connected to the VPN, minikube is starting as expected:
PS C:\Windows\system32> minikube start
* minikube v1.9.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Updating the running hyperv "minikube" VM ...
* Preparing Kubernetes v1.18.0 on Docker 19.03.8 ...
E0408 01:00:31.223159 17528 kubeadm.go:331] Overriding stale ClientConfig host https://192.168.137.249:8443 with https://172.17.118.34:8443
* Enabling addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube"
Once I am connectong to the VPN antri triing to start the minikube, it fails with an error:
PS C:\Windows\system32> minikube start
* minikube v1.9.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Updating the running hyperv "minikube" VM ...
! StartHost failed, but will try again: provision: IP not found
* Updating the running hyperv "minikube" VM ...
*
X Failed to start hyperv VM. "minikube start" may fix it.: provision: IP not found
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
- https://github.com/kubernetes/minikube/issues/new/choose
I was facing a similar issue while running the following command:
minikube start --vm-driver="hyperv" --hyperv-virtual-switch="minikube"
Then I went through some github and stackoverflow threads and was able to resolve my issue by running following command:
minikube delete
minikube start --vm-driver="hyperv"
In my case, passing 'hyperv-virtual-switch' argument was causing the issue.
I would suggest you to check if your virtual switch is configured with your vpn network or not.
If not, then you can perform the following steps to do so:
Go to network and sharing center settings of windows:
Select your network and open the properties window for it. Go to the "Sharing" tab and allow your configured virtual switch over there.
Setting up Minikube on my Windows 10 Surface laptop and the cluster fails to create. Performed the following steps:
Installed all Hyper-V features
Created Hyper-V external switch
Installed Minikube using choco install minikube
Configured minikube using minikube config --driver=hyperv
Attempted to start minikube using minikube start --hyperv-virtual-switch=ExternalWifi
When attempting to start, minikube throws the following error:
PS C:\WINDOWS\system32> minikube start --driver=hyperv
* minikube v1.8.1 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on user configuration
* Downloading VM boot image ...
* Creating hyperv VM (CPUs=2, Memory=4077MB, Disk=20000MB) ...
* Downloading preloaded images tarball for k8s v1.17.3 ...
> preloaded-images-k8s-v1-v1.17.3-docker-overlay2.tar.lz4: 280.46 MiB / 499E0309 09:38:58.605779 11932 main.go:106] libmachine: [stderr =====>] : Hyper-V\New-VM : Failed to modify device 'Memory'.
Invalid memory value assigned for 'minikube'. Memory values must be properly aligned.
'minikube' failed to modify device 'Memory'. (Virtual machine ID 06BCBFDB-C000-4BF4-97BF-D16008DAC326)
Invalid memory value assigned for 'minikube'. The memory value assigned ('4077' MB) is not properly aligned. Try again with a memory value that is properly aligned. (Virtual machine ID
06BCBFDB-C000-4BF4-97BF-D16008DAC326)
At line:1 char:1
+ Hyper-V\New-VM minikube -Path 'C:\Users\myuser\.minikube\machines\m ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-VM], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.NewVM
> preloaded-images-k8s-v1-v1.17.3-docker-overlay2.tar.lz4: 289.28 MiB / 499*
X Unable to start VM. Please investigate and run 'minikube delete' if possible: creating host: create: creating: exit status 1
When attempting to manually create a VM using the same parameters that the minikube setup was attempting to use, I discovered that Hyper-V requires you to assign memory in 2 MB increments. Minikube was attempting to create a VM with 4077 MB of memory which was causing the failure. When I ran minikube setup with the command below, initialization completed successfully:
minikube start --driver=hyperv --memory=4078m
I used to have a similar issue.It stuck right after:
"Creating hyperv VM (CPUs=2, Memory=4096MB, Disk=20000MB)"
That`s why I delete minikube with:
minikube delete
And run it again with less ram:
minikube start --driver=hyperv --cpus 2 --memory=2048
Trying to setup minikube under Windows 10 using Hyper-V. https://blog.tekspace.io/getting-started-with-kubernetes-on-windows-10-with-hyper-v/
I found several articles stating that you need to start it with a switch --vm-driver=hyperv, however this does not work for me.
Command I'm running:
minikube start --vm-driver hyperv
What gives?
EDIT1:
Getting stuck on:
Creating hyperv VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
Looks like your old minikube VirtualBox VM is in your MINIKUBE_HOME directory.
minikube delete is also failing because it looks like you uninstall VirtualBox.
You probably need to delete your MINIKUBE_HOME directory completely and then start with:
$ minikube start --vm-driver hyperv
Update:
In addition please refer to Microsoft Hyper-V driver
Requirements:
Hyper-V enabled
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Note:
If Hyper-V was not previously active, you will need to reboot.
An active Hyper-V switch - please foloow the Network Configuration section.
Set the switch you created as the minikube default in the step 2.
minikube config set hyperv-virtual-switch ExternalSwitch
minikube start --vm-driver=hyperv
minikube config set vm-driver hyperv
I installed Minikube on Windows 10 but can't get it to run. I tried to start it with:
minikube start --vm-driver=hyperv
The first error was:
[HYPERV_NO_VSWITCH] create: precreate: no External vswitch found. A valid vswitch must be available for this command to run.
I then searched on Google and found the solution to this error with this page:
https://www.codingepiphany.com/2019/01/04/kubernetes-minikube-no-external-vswitch-found/
I then fixed the problem by defining a vswitch but I got this error:
minikube start --vm-driver hyperv --hyperv-virtual-switch "Minikube"
o minikube v1.0.1 on windows (amd64)
$ Downloading Kubernetes v1.14.1 images in the background ...
> Creating hyperv VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
! Unable to start VM: create: creating: exit status 1
* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
- https://github.com/kubernetes/minikube/issues/new
This is a pretty generic error. What do I do to get this working? Thanks!
You need to create a Virtual Switch in the HyperV GUI ins Windows and then run it with
minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
Please see the configuration details in this link
https://medium.com/#JockDaRock/minikube-on-windows-10-with-hyper-v-6ef0f4dc158c
I got the same problem just now.
Unable to understand the note given by cmd, I tried open the minikube VM via the Hyper-V GUI, and the GUI provided me with a more comprehensible note: "memory is not adequate"—— exactly this note helped me to know the problem. I then closed Docker VM (I had opened before), which must have taken a large amount of memory, and started minikube in cmd again, the minikube VM just started as expected.
In a word, this is a problem of limited memory