How to use libvirt in Multipass

If you want more control over your VMs after they are launched, you can use the experimental libvirt driver:


Switch to the libvirt driver

Make sure you have libvirt installed, as Multipass is using the libvirt daemon running on your host:

# use the equivalent for your distribution
$ sudo apt install libvirt-daemon-system

Allow Multipass to use your local libvirt:

# connect the libvirt interface/plug
$ snap connect multipass:libvirt

You can then switch the driver

# you'll need to stop all the instances first
$ multipass stop --all

# and tell Multipass to use libvirt
$ sudo multipass set local.driver=libvirt

All your existing instances will be migrated and can be used straight away.

NOTE: You can still use the multipass client and the tray icon, and any changes you make to the configuration of the instance in libvirt will be persistent. They may not be represented in Multipass commands such as multipass info, though.

Using virsh

After launching an instance, you can see it show up in virsh (see man virsh for a command reference):

$ virsh list                             
 Id   Name                   State
 1    unaffected-gyrfalcon   running

Using virt-manager

You can also use the graphical virt-manager interface:

Switching back

To switch back to the default, use the qemu driver:

# stop all instances again
$ multipass stop --all

# and switch back to the qemu driver
$ sudo multipass set local.driver=qemu

Here, too, existing instances will be migrated.

NOTE: this will make you lose any customizations you made to the instance in libvirt.

Last updated 15 hours ago.