Minikube: hyperv: Error starting stopped host: exit status 1 (no IP)

Created on 15 Sep 2017  Â·  37Comments  Â·  Source: kubernetes/minikube

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Bug

Please provide the following details:

Environment:

Minikube version (use minikube version): v0.22.1

  • OS : Windows 10 64bit Pro
  • VM Driver : hyperv
  • ISO version : v0.23.3
  • Install tools: download from the link

What happened:

PS C:\Users\tw0517tw> minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch" --v=0
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
E0915 14:57:49.889147   17168 start.go:143] Error starting host: Error starting stopped host: exit status 1.

 Retrying.
E0915 14:57:49.892146   17168 start.go:149] Error starting host:  Error starting stopped host: exit status 1
PS C:\Users\tw0517tw> minikube stop
Stopping local Kubernetes cluster...
Error stopping machine:  Error stopping host: minikube: exit status 1
PS C:\Users\tw0517tw> minikube delete
Deleting local Kubernetes cluster...
Errors occurred deleting machine:  exit status 1
PS C:\Users\tw0517tw> minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch" --v=0
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
E0915 14:58:16.971930   16436 start.go:143] Error starting host: Error creating host: Error executing step: Creating VM.
: exit status 1.

 Retrying.
E0915 14:58:16.977940   16436 start.go:149] Error starting host:  Error creating host: Error executing step: Creating VM.
: exit status 1

What you expected to happen:

Start minikube cluster

How to reproduce it (as minimally and precisely as possible):

Follow install instructions, including setup virtual switch.

Anything else do we need to know:

Most helpful comment

@ohdihe

  1. Create a "minikube" external Hyper-V virtual switch.
  2. Put minikube.exe into a folder on a disk (e.g. k:\minikube).
  3. Add the folder to PATH.
  4. Create a folder on the same logical disk as the minikube.exe's folder (e.g. k:\minikube_home).
  5. Set MINIKUBE_HOME env var to the folder in p. 4
  6. CD to the minikube.exe's folder.
  7. minikube start --vm-driver="hyperv" --memory=4096 --cpus=4 --hyperv-virtual-switch="minikube" --v=7 --alsologtostderr

All 37 comments

Have you tried with an elevated command?

I just tried run PowerShell as Administrator then get:

PS C:\WINDOWS\system32> minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch" --v=0
Starting local Kubernetes v1.7.5 cluster...
Starting VM...

it hangs there for about 20 minutes.
still waiting

maybe related to the vm ip issues #1945

ok I think it's #1945 now. closing.

the same result is for me at version 1.8

Hard to say what is wrong without logs. consider starting with the --show-libmachine-logs and increased verbosity -v5.

Creating VM is not an IP related issue, but rather disk space, or not able to find the Virtual Switch (be aware, the search for switch names is case sensitive in docker-machine)

@tw0517tw
when it hangs at Starting VM, it is likely an IP related issue. Be aware that you need to use an External Switch with DHCP IPv4 for best results, or a way to provision a DHCP address on an internal switch with NAT.

@TopGunBasten
same as which? There are several different reports here... please consider one of the provided options to investigate. If the issue remains, please file a new issue, or find an issue that is close to your problem that is open.

Same error on win 10:

$ minikube start --vm-driver "hyperv" -v5
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0203 07:11:50.162252    6008 start.go:159] Error starting host: Error starting stopped host: exit status 1.

 Retrying.
E0203 07:11:50.164254    6008 start.go:165] Error starting host:  Error starting stopped host: exit status 1

I don't know why anything relating to windows drives me nuts!!!. Trying to get minikube to function on my work laptop. My PC (Mac) works great.
I get same error as OP. I created a hyperv-virtual-switch and disabled dynamic memory within the hyperv settings. It gets to 10% and then quit with the below error.

λ minikube start --hyperv-virtual-switch=ohdihe
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0207 22:01:28.436785 13960 start.go:159] Error starting host: Error starting stopped host: exit status 1.

Retrying.
E0207 22:01:28.450791 13960 start.go:165] Error starting host: Error starting stopped host: exit status 1

@ohdihe

  1. Create a "minikube" external Hyper-V virtual switch.
  2. Put minikube.exe into a folder on a disk (e.g. k:\minikube).
  3. Add the folder to PATH.
  4. Create a folder on the same logical disk as the minikube.exe's folder (e.g. k:\minikube_home).
  5. Set MINIKUBE_HOME env var to the folder in p. 4
  6. CD to the minikube.exe's folder.
  7. minikube start --vm-driver="hyperv" --memory=4096 --cpus=4 --hyperv-virtual-switch="minikube" --v=7 --alsologtostderr

@vasily-kirichenko tks very much!

The p. 4 is important!

and exec minukube delete
.

@vasily-kirichenko
Steps you provided helped. However, it seems to not get any IP address. It just keeps repeating this over and over:
[executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM minikube ).networkadapters[0]).ipaddresses[0]
[stdout =====>] :
[stderr =====>] :
[executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM minikube ).state
[stdout =====>] : Running

[stderr =====>] :
[executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM minikube ).networkadapters[0]).ipaddresses[0]
[stdout =====>] :
[stderr =====>] :

Docker-machine is up and running and has allocated IP address.
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
minikubenodes - hyperv Running tcp://10.200.131.51:2376 v18.01.0-ce

Please, do you what the appropriate steps I should take to resolve this.

Thanks

@ohdihe have you configured the virtual switch like this?

image

@vasily-kirichenko

Thanks for the quick response. Yes I have. It was the first thing that I did.

No further ideas, sorry. I've used Minicube for few days myself :)

@vasily-kirichenko

Thanks for providing me helpful suggestions.

I'm facing the same issue with Windows 10. Anyone found a solution for this?

@vasily-kirichenko

Steps 4 and 5 solved it for me.

It could also be that I wasn't running Powershell as administrator so it didn't have permission to modify/create the .minikube directory

Confirmed. Need to run Powershell as administrator so that minikube can create a .minikube directory in the default MINIKUBE_HOME directory ($HOME). For me that was c:\users\stealthfox\

It's too bad this doesn't work. Was really hoping to try this thing out. I also get the same error as OP.

Maybe you all notice better than me, but mine ended up being I bound my virtual switch to wifi instead of ethernet.

@madisonleavo your observation was right on. Thanks!

So I created two vswitches - primary (for LAN line) and one wireless-vswitch for wireless.

minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
or
minikube start --vm-driver hyperv --hyperv-virtual-switch "Wireless Virtual Switch"

minikube-primary-vlan

minikube-wireless-vlan

Would it be possible to use the Default Switch instead?
Please have a go, and let us know the result...

On Sat, Apr 21, 2018 at 6:49 AM, Anthony-sdsc notifications@github.com
wrote:

@madisonleavo https://github.com/madisonleavo your observation was
right on. Thanks!

So I created two vswitches - primary (for LAN line) and one
wireless-vswitch for wireless.

minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual
Switch"
or
minikube start --vm-driver hyperv --hyperv-virtual-switch "Wireless
Virtual Switch"

[image: minikube-primary-vlan]
https://user-images.githubusercontent.com/33666561/39076760-42d0be02-44b2-11e8-8a58-95001ad9648a.PNG

[image: minikube-wireless-vlan]
https://user-images.githubusercontent.com/33666561/39076761-4713afa6-44b2-11e8-89ca-a9e644755326.PNG

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/minikube/issues/1967#issuecomment-383241725,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAHZklbZ5EhgwktYmTOngI_7dCvOKeRks5tqmXhgaJpZM4PYkz_
.

--

Gerard Braad | http://gbraad.nl
[ Doing Open Source Matters ]

Thanks to @vasily-kirichenko, I could see what it was a Memory insufficiency issue. Trying to allocate at least 2GB on RAM when Running Docker and Dev environment it´s almost imposible :)

Tried to stop all hyperv vm's, made sure I have 8 gb free out of my 16gb. Still not working with or without the switch arg. Kubectl 1.9 minikube 0.28.

I have also tried to delete the .minikube directory several times. Same issue, stuck after downloading.

Got it to work. Rolled back to 0.27 and reinstalled kubectl
Steps:

  1. Stop and delete VM minikube in hyperv.
  2. Delete .minikube directory
  3. re-install --force minikube 0.27
    (4. re-install --force kubectl.)

Had the same issue in minikube version: v0.28.2.
Fixed by explicitly adding --memory=2048 parameter to "minikube.exe start --vm-driver=hyperv --hyperv-virtual-switch=" command (together with all previous tricks like setting MINIKUBE_HOME env variable, etc. )

Had the same issue in minikube version 0.28.2.
Here's what worked for me. I started the minikube without specifying the virtual switch.
$ minikube start --vm-driver hyperv
Also I edited the settings for VM in Hyper-V manager e.g. allocating explicitly 1024 MB memory and disabling the dynamic memory. I think enabled dynamic memory is creating issues. Not sure though.
capture

Got it to work. Rolled back to 0.27 and reinstalled kubectl
Steps:

  1. Stop and delete VM minikube in hyperv.
  2. Delete .minikube directory
  3. re-install --force minikube 0.27
    (4. re-install --force kubectl.)

works for me , downgraded the minikube version for 29 to 28. and it worked after that

What worked for me was this. (similar to 007souvikdas answer). I didn't manually create a .minikube directory at but installed minikube using chocolatey.

Make sure you have an Virtual Switch set up as mentioned here before and your command line runs as Administrator

  1. Stop and delete Virtual Macine
  2. run 'minikube delete' in command line (it exits with an error but thats ok, if you installed via chocolatey like i did also delete the .minikube folder from C:\Users\YourUserName)
  3. run 'minikube start --vm-driver="hyperv" --hyperv-virtual-switch="nameofyourswitch"'

after that. Give it time. It took 5 minutes to go through the complete process for me

@ohdihe

  1. Create a "minikube" external Hyper-V virtual switch.
  2. Put minikube.exe into a folder on a disk (e.g. k:\minikube).
  3. Add the folder to PATH.
  4. Create a folder on the same logical disk as the minikube.exe's folder (e.g. k:\minikube_home).
  5. Set MINIKUBE_HOME env var to the folder in p. 4
  6. CD to the minikube.exe's folder.
  7. minikube start --vm-driver="hyperv" --memory=4096 --cpus=4 --hyperv-virtual-switch="minikube" --v=7 --alsologtostderr

Hello, may i know what do you mean by "p. 4 in step 5"?

I've faced the same issue last night and I'll just leave here what fixed my issue in case it helps someone. I've tried everything mentioned here on this page, but nothing worked. All I had to do is uninstall Hyper-V and reinstall, reboot PC.

Hello, may i know what do you mean by "p. 4 in step 5"?

the VM artifacts and the executable need to end up on the same drive. This can be C: or something else, but they can not be different. If minikube.exe is started from somewhere on the C drive, like the downloads folder, you have to make sure the .minikube folder is on the C drive. this is mostly the case for a standard setup, as it ends up in C:\users\...\ but when yu are in a corporate environment your homefolder might be on X: for instance

@ohdihe

  1. Create a "minikube" external Hyper-V virtual switch.
  2. Put minikube.exe into a folder on a disk (e.g. k:\minikube).
  3. Add the folder to PATH.
  4. Create a folder on the same logical disk as the minikube.exe's folder (e.g. k:\minikube_home).
  5. Set MINIKUBE_HOME env var to the folder in p. 4
  6. CD to the minikube.exe's folder.
  7. minikube start --vm-driver="hyperv" --memory=4096 --cpus=4 --hyperv-virtual-switch="minikube" --v=7 --alsologtostderr

Thank you, by following your solution, my problem is fixed!

For me it was much simpler to use the docker driver on Windows. Just run minikube start --driver=docker and it works without problems. Make sure your docker daemon is running.

Do not forget to select wireless option if you are on Wifi

image
Create a "minikube" external Hyper-V virtual switch.
Put minikube.exe into a folder on a disk (e.g. k:\minikube).
Add the folder to PATH. (Restart the computer)
Create a folder on the same logical disk as the minikube.exe's folder (e.g. k:\minikube_home).
Set MINIKUBE_HOME env var to the folder in p. 4
CD to the minikube.exe's folder.
minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"

Was this page helpful?
0 / 5 - 0 ratings