minikube: minikube fails to start with kvm2/kvm drivers with "Domain not found" error

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

Please provide the following details:

Environment: Fedora 24 (not VM, host) Minikube version (use minikube version): v0.24.1

  • OS (e.g. from /etc/os-release): Fedora 24
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): KVM2 / KVM (tried both)
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION):
  • Install tools:
  • Others:

What happened: when starting minikube with minikube start --vm-driver kvm2 or with minikube start --vm-driver kvm it fails with:

Starting local Kubernetes v1.8.0 cluster… Starting VM… E0110 15:27:36.156882 21701 start.go:150] Error starting host: Error getting state for host: getting connection: looking up domain: virError(Code=42, Domain=10, Message=‘Domain not found: no domain with matching name ‘minikube’’).

What you expected to happen: minikube to start successfully

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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 36 (3 by maintainers)

Most upvoted comments

Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0129 14:58:09.915923    8668 start.go:159] Error starting host: Error getting state for host: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'').

 Retrying.
E0129 14:58:09.916535    8668 start.go:165] Error starting host:  Error getting state for host: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'')

I tried to delete and reinstall everything however had the same issue again, i noticed though that the folder .minikube was still there so i deleted this folder and tried again and then everything was ok. Hopefully this might help someone else as well

openstack@T400:~$ rm -rf .minikube/
openstack@T400:~$ minikube start --vm-driver=kvm2
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
Downloading Minikube ISO
 142.22 MB / 142.22 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading localkube binary
 162.41 MB / 162.41 MB [============================================] 100.00% 0s
 0 B / 65 B [----------------------------------------------------------]   0.00%
 65 B / 65 B [======================================================] 100.00% 0sSetting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
openstack@T400:~$ kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
deployment "hello-minikube" created
openstack@T400:~$ kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
openstack@T400:~$ kubectl get pod
NAME                            READY     STATUS              RESTARTS   AGE
hello-minikube-c6c6764d-cmxw5   0/1       ContainerCreating   0          28s
openstack@T400:~$ curl $(minikube service hello-minikube --url)
Waiting, endpoint for service is not ready yet...
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.39.60:8080/

SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001

HEADERS RECEIVED:
accept=*/*
host=192.168.39.60:32025
user-agent=curl/7.47.0
BODY:
-no body in request-openstack@T400:~$ 
openstack@T400:~$ minikube version
minikube version: v0.25.0

Have you tried to delete and start again? The issue with none likely comes because it wants to do a a restart, and in that case a change of vmdriver is ignored

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

Also seeing this on Arch.

@rstoikos I tried now your suggestion of deleting the .minikube folder. After doing it and running minikube, I got another error (and if I rerun the minikube, I get back to the original error)

> E0129 15:28:30.672583    8639 start.go:150] Error starting host: Error creating host: Error creating machine: Error in driver during machine creation: creating domain: Error defining domain xml: 
> <domain type='kvm'>
>   <name>minikube</name> 
>   <memory unit='MB'>2048</memory>
>   <vcpu>2</vcpu>
>   <features>
>     <acpi/>
>     <apic/>
>     <pae/>
>   </features>
>   <os>
>     <type>hvm</type>
>     <boot dev='cdrom'/>
>     <boot dev='hd'/>
>     <bootmenu enable='no'/>
>   </os>
>   <devices>
>     <disk type='file' device='cdrom'>
>       <source file='/home/abonas/.minikube/machines/minikube/boot2docker.iso'/>
>       <target dev='hdc' bus='scsi'/>
>       <readonly/>
>     </disk>
>     <disk type='file' device='disk'>
>       <driver name='qemu' type='raw' cache='default' io='threads' />
>       <source file='/home/abonas/.minikube/machines/minikube/minikube.rawdisk'/>
>       <target dev='hda' bus='virtio'/>
>     </disk>
>     <interface type='network'>
>       <source network='default'/>
>       <mac address='1c:46:54:54:a2:7a'/>
>       <model type='virtio'/>
>     </interface>
>     <interface type='network'>
>       <source network='docker-machines'/>
>       <mac address='1c:46:54:54:a2:7a'/>
>       <model type='virtio'/>
>     </interface>
>     <serial type='pty'>
>       <source path='/dev/pts/2'/>
>       <target port='0'/>
>     </serial>
>     <console type='pty' tty='/dev/pts/2'>
>       <source path='/dev/pts/2'/>
>       <target port='0'/>
>     </console>
>     <rng model='virtio'>
>       <backend model='random'>/dev/random</backend>
>     </rng>
>   </devices>
> </domain>
> : virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for domaintype=kvm ').
> 

For me, it was a full hard disk! minikube/kvm2 tries to create .minikube/machines/minikube/minikube.rawdisk with ~20GB. Seems like there’s no error message if there’s not enough room…

Also try: sudo apt-get install ebtables sudo systemctl restart libvirtd minikube delete minikube start --vm-driver=kvm2

Have the same error.

Have tried:

  • running as root
  • rm -rf ~/.minikube
  • minikube delete

So far nothing has worked.

On Centos7 i had to run sudo systemctl restart libvirtd

I also had this issue …

I could start minikube only as root … After I changed the owner on /var/run/libvirt to my user sudo chown -R phico:libvirtd /var/run/libvirt Then a little cleaning (minikube delete rm .minikube)

Now it starts !

That could be that your user is not in libvirt group (or you added user to group without relogin)

It could be like that because of my openstack cloud VM config. CentOS Linux release 7.4.1708 (Core)

KVM2

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 minikube-net         active     yes           yes

there is no ‘default’ one so if I run like that: # minikube start --vm-driver kvm2

it’s going to fail

Starting VM...  

E0509 15:16:02.440382    1485 start.go:159] Error starting host: Error creating host: Error creating machine: Error in driver during machine creation: Error creating VM: virError(Code=43, Domain=19, Message='Network not found: no network with matching name 'default'').

to make it work: # minikube start --vm-driver kvm2 --kvm-network minikube-net

KVM

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 docker-machines      active     yes           yes

Similar like above to make it work: # minikube start --vm-driver kvm --kvm-network docker-machines

On Ub16.04, when trying to get kvm2 working, I also found that minikube had made a half-baked ~/.minikube directory. I moved that out of the way, and also had to change the permissions on /var/run/libvirt to myuser:libvirtd, the new group required for kvm2 install. Then, when I ran minikube for the first time and it had pulled down a new minikube image, it made the right ~/.minikube dir.

ubuntu 18.04 1.

virt-host-validate

QEMU: Checking if device /dev/kvm is accessible: FAIL

If the mentioned test does not pass for you try this link: https://askubuntu.com/questions/1050621/kvm-is-required-to-run-this-avd then restart your machine

  1. minikube fails to start with kvm2/kvm drivers with “Domain not found” error

To make kvm2 the default driver:

minikube config set vm-driver kvm2

then:

minikube delete minikube start