14 Oct 2011, 13:57

FreeBSD 9.0 guest with virtio support in KVM


Performance are really bad for FreeBSD in KVM, one solution is to use paravirtualized driver, virIO.

At the time of writing FreeBSD 9.0 is beta 3 and the last commit in the virtio project is 225710

cd /usr/src/sys/dev
svn co http://svn.freebsd.org/base/projects/virtio/sys/dev/virtio
cd /usr/src/sys/modules
svn co http://svn.freebsd.org/base/projects/virtio/sys/modules/virtio
cd /usr/src/sys/modules/virtio

make install

add this to /boot/loader.conf


# dmesg | grep -i  virtio
vtnet0:  on virtio_pci0
virtio_pci1:  port 0xc060-0xc07f irq 11 at device 4.0 on pci0
vtballoon0:  on virtio_pci1
virtio_pci2:  port 0xc080-0xc0bf mem 0xf2040000-0xf2040fff irq 10 at device 5.0 on pci0
vtblk0:  on virtio_pci2

It needs further tests, but seems to work except for the net driver which give me no links, (you can still use the previous net driver in KVM)

EDIT: the vtnet driver issue is solve and should be in the trunk