canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.77k stars 642 forks source link

libvirt failing ungracefully to missing QEMU #1166

Open Saviq opened 4 years ago

Saviq commented 4 years ago

When trying to launch with libvirt without qemu installed:

$ multipass sh
launch failed: invalid domain pointer in virDomainCreate

And the logs:

lis 04 16:09:53 michal-laptop multipass.multipassd[22054]: libvirt: QEMU Driver error : internal error: Cannot find suitable emulator for x86_64
lis 04 16:09:53 michal-laptop multipassd[22054]: Failed to determine libvirtd version.
lis 04 13:40:19 michal-laptop multipass.multipassd[9325]: libvirt: QEMU Driver error : Domain not found: no domain with matching name 'primary'
lis 04 13:40:19 michal-laptop multipass.multipassd[9325]: libvirt: Capabilities Utils error : invalid argument: could not find capabilities for arch=x86_64 domaintype=kvm
lis 04 13:40:19 michal-laptop multipass.multipassd[9325]: libvirt: Domain error : invalid domain pointer in virDomainGetXMLDesc
lis 04 13:40:19 michal-laptop multipass.multipassd[9325]: libvirt: Network Driver error : invalid MAC address
…
townsend2010 commented 4 years ago

I'm unable to reproduce.

I did the following:

And it downloaded the image and created a new primary instance and shelled into it.

townsend2010 commented 4 years ago

Also, I would be very surprised if libvirt would break the API that badly, especially between interim versions (5.0 on disco vs. 5.4 on eoan).

Saviq commented 4 years ago

OK this seems to be me missing qemu-system-x86 on the host…

So the real issue is that we're missing that error:

lis 04 16:09:53 michal-laptop multipass.multipassd[22054]: libvirt: QEMU Driver error : internal error: Cannot find suitable emulator for x86_64
lis 04 16:09:53 michal-laptop multipassd[22054]: Failed to determine libvirtd version.
townsend2010 commented 4 years ago

@Saviq,

So none of these errors were printed out in the client when it failed? But yeah, this should be part of the libvirt health check, so we need some way to probe libvirtd to see if qemu-system-x86_64 is available for libvirtd to use.

Saviq commented 4 years ago

So none of these errors were printed out in the client when it failed?

Yeah, just this:

$ multipass sh
launch failed: invalid domain pointer in virDomainCreate

So we're probably also lacking some error handling when creating the domain.

jhcook commented 2 years ago

I ran across this problem on RHEL8, and the answer is that file now resides at /usr/libexec/qemu-kvm. I created a link like so, and it fixed he problem for me:

ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64