What virtualization does incus uses for VMs

I would like to have clarity about which virtualization type incus uses for VMs (type1 or 2). The incus documentation says it is using qemu for VMs. Can we use KVM, as we would like to do hardware virtualization for better performance.

I have created a VM and it shows me the following output. Does it mean that the machine is using KVM?

root@ubuntu-vm:~# systemd-detect-virt

root@ubuntu-vm:~# hostnamectl
Static hostname: ubuntu-vm
Icon name: computer-vm
Chassis: vm πŸ–΄
Machine ID: 92bc13b027ec4bd39ca72584934be8a5
Boot ID: 9db3e6570b4345d4969ac9b87c5bfc23
> Virtualization: kvm
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-31-generic
Architecture: x86-64
Hardware Vendor: QEMU
Hardware Model: Standard PC Q35 + ICH9, 2009
Firmware Version: unknown
Firmware Date: Wed 2022-02-02

On the host machine, the VM is running as follows:

$ ps ax | grep qemu
602887 ? Sl 2:28 /opt/incus/bin/qemu-system-x86_64 -S -name ubuntu-vm -uuid 92bc13b0-27ec-4bd3-9ca7-2584934be8a5 -daemonize -cpu host,hv_passthrough -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=allow,resourcecontrol=deny -readconfig /run/incus/ubuntu-vm/qemu.conf -spice unix=on,disable-ticketing=on,addr=/run/incus/ubuntu-vm/qemu.spice -pidfile /run/incus/ubuntu-vm/qemu.pid -D /var/log/incus/ubuntu-vm/qemu.log -smbios type=2,manufacturer=LinuxContainers,product=Incus -runas incus
607301 pts/8 S+ 0:00 grep --color=auto qemu

I would like to have clarity about which virtualization type incus uses for VMs

It’s kvm + qemu. Try:

cat /run/incus/ubuntu-vm/qemu.conf

You should see:

# Machine
graphics = "off"
type = "q35"
accel = "kvm"    <<<< NOTE
usb = "off"
... etc

Thanks for the quick response. So this means that the VM is getting the performance advantage of hardware acceleration?

KVM is a Type 1 hypervisor.

QEMU is a Type 2 hypervisor and an emulator.

In Incus, QEMU is used as a device emulation back-end for virtual machines running under a separate hypervisor (and this is KVM). KVM is what gives the good performance due to hardware acceleration on virtualization.