271 | | Instead of completely emulating existing hardware devices (network interface, block device, GPU, ...), Qemu allows to present virtual devices to the guest, which directly access host's hardware. This allows to get near bare metal performance in virtual machines. Those devices are known as ''virtio'' devices, and the kernel has powerful drivers for them. |
| 271 | Instead of completely emulating existing hardware devices (network interface, block device, GPU, ...), qemu allows to present virtual devices to the guest, which directly access host's hardware. This allows to get near bare metal performance in virtual machines. Those devices are known as ''virtio'' devices, and the linux kernel has powerful drivers for them. |
286 | | Now that we have the machine we need to enable the appropriate options in the guest kernel (TODO). |
| 286 | Now that we have the machine, we need to enable the appropriate options in the guest kernel: |
| 287 | {{{ |
| 288 | Device Drivers ---> |
| 289 | [*] Block devices ---> CONFIG_BLK_DEV |
| 290 | <*> Virtio block driver CONFIG_VIRTIO_BLK |
| 291 | SCSI Device support ---> |
| 292 | [*] SCSI low-level drivers ---> CONFIG_SCSI_LOWLEVEL |
| 293 | <*> virtio-scsi support CONFIG_SCSI_VIRTIO |
| 294 | [*] Virtio drivers ---> CONFIG_VIRTIO_MENU |
| 295 | <*> PCI driver for virtio devices CONFIG_VIRTIO_PCI |
| 296 | }}} |
| 297 | Note that you need first to select CONFIG_VIRTIO_MENU and CONFIG_VIRTIO_PCI so that the other options appear. |
| 298 | |
| 299 | The last thing to remember is that the virtio drives are named /dev/vdxn by the kernel, where ''x'' is the drive letter and ''n'' the partition number. Don't forget to update your /etc/fstab file and to change the linux command line in grub! |
| 300 | |
| 301 | === Virtio GPU === |
| 302 | TODO |