Linux – Am I using virtio for the KVM guest

kvm-virtualizationlinuxlinux-networkingvirtiovirtualization

In one of my KVM guest, when I typed the following command, I get the following

/sbin/lsmod | grep vi
virtio_balloon          3692  0 

So does it mean I am using virtio?

Update:

When I type

cat "/boot/config-`uname -r`" | grep -i vir

I can see

CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_VIRT_TO_BUS=y
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
# CONFIG_FB_VIRTUAL is not set
CONFIG_SND_VIRMIDI=m
CONFIG_SND_VIRTUOSO=m
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_VIRTUALIZATION=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=m

So sound like I am using virtio already?

Best Answer

KVM provides paravirtualization drivers for several bits of hardware; this particular one is the memory balloon driver.

In particular, you should see virtio_net when using the virtio network drivers, and virtio_blk when using the block device (disk) driver. And in the latter case, your disk would be /dev/vda instead of /dev/sda.

In your case, the virtio disk and network drivers are compiled into the kernel, rather than as modules, so you would not see them with lsmod.

CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y

Several other less important virtio drivers also exist on your system and are compiled directly into the kernel (such as VIRTIO_PCI, the paravirtualized PCI bus).