VIRTIO(4)

πŸ“¦
version 15.1 Β· 4 versions
, in freebsd 14.5, freebsd 15.1

πŸ’– VIRTIO(4) β€” the VirtIO device support glow-up πŸ’–

okay so this is VIRTIO(4), straight out of the Kernel Interfaces Manual, and bestie, it's literally the page that explains how your VM gets its I/O without the hypervisor doing that slow, cringe emulation thing. let's get into it 🫢


✨ NAME ✨

virtio β€” VirtIO Device Support. that's it, that's the vibe.


🌸 SYNOPSIS 🌸

so if you wanna compile VirtIO device support into the kernel (main character energy), you drop these lines into your kernel configuration file:

device virtio
device virtio_pci

or, if you'd rather load VirtIO support as modules at boot time (lowkey easier), you put these in loader.conf(5):

virtio_load="YES"
virtio_pci_load="YES"

either way, slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so VirtIO is a specification for para-virtualized I/O in a virtual machine (VM). and like, here's the context: traditionally the hypervisor emulated real devices β€” an Ethernet interface, a disk controller, whatever β€” just to give the VM some I/O. and that emulation? often inefficient. not it. πŸ’€

VirtIO defines an interface for efficient I/O between the hypervisor and the VM. the virtio module provides a shared memory transport called a virtqueue (iconic, honestly). the virtio_pci device driver represents an emulated PCI device that the hypervisor makes available to the VM β€” and that device provides all the probing, configuration, and interrupt notifications you need to interact with the hypervisor. no cap.

FreeBSD supports the following VirtIO devices, and yes, each one has its own little driver bestie:

  • Ethernet β€” an emulated Ethernet device is provided by the vtnet(4) device driver. 🐟
  • Block β€” an emulated disk controller is provided by the virtio_blk(4) device driver.
  • Console β€” provided by the virtio_console(4) driver.
  • Entropy β€” provided by the virtio_random(4) driver. random but make it ✨entropy✨
  • Balloon β€” a pseudo-device that lets the VM release memory back to the hypervisor, provided by the virtio_balloon(4) device driver.
  • GPU β€” graphics support is provided by the virtio_gpu(4) device driver. 🌈
  • SCSI β€” an emulated SCSI HBA is provided by the virtio_scsi(4) device driver.

πŸŽ€ LOADER TUNABLES πŸŽ€

these tunables can be set at the loader(8) prompt before you boot the kernel, or stored in loader.conf(5). your call, bestie 🫢

  • hw.virtio.pci.disable_msix β€” if set to 1, disables MSI-X. the default value is 0.
  • hw.virtio.pci.transitional β€” for a transitional virtio device, this tunable says whether to negotiate modern mode and use the modern virtio driver (1), or negotiate legacy mode and use the legacy virtio driver (0). the default value is 0.
heads up: those defaults are 0 and 0, so don't come for me if you assumed otherwise πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

virtio_balloon(4), virtio_blk(4), virtio_console(4), virtio_gpu(4), virtio_random(4), virtio_scsi(4), vtnet(4)

go read them, they're all part of the family fr fr πŸ’œ


⭐ HISTORY ⭐

support for VirtIO first appeared in FreeBSD 9.0. vintage but make it functional πŸŽ€


🌸 AUTHORS 🌸

FreeBSD support for VirtIO was first added by Bryan Venteicher <bryanv@FreeBSD.org>. thank you for your service, king πŸ‘‘


and that's the whole page, bestie! this lil rendition comes to you from Debian, dated April 4, 2026 β€” mwah, bye! πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from