FreeBSD Guest Notes: Difference between revisions

From Proxmox VE
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:
Tweaks and tips for better performance with FreeBSD on KVM.
Tweaks and tips for better performance with FreeBSD on KVM.
==Enable Virto==
==Enable Virto==
'''WARNING: This part is currently in test - it may render your system un-bootable when you make changes to your <code>/etc/fstab</code>.'''
* Install virtio-kmod:
* Install virtio-kmod:
<pre>
<pre>
Line 49: Line 48:
  6    1 0xffffffff813ea000 3210    virtio_balloon.ko
  6    1 0xffffffff813ea000 3210    virtio_balloon.ko
</pre>
</pre>
==External Links==
* [http://viktorpetersson.com/2012/01/16/how-to-upgrade-freebsd-8-2-to-freebsd-9-0-with-virtio/ How to upgrade FreeBSD 8.2 to FreeBSD 9.0 with Virtio] - contains useful information on setting up virtio on freebsd 9.
* [http://www.freshports.org/emulators/virtio-kmod FreshPorts virtio-kmod] page.

Revision as of 21:08, 6 October 2012

Tweaks and tips for better performance with FreeBSD on KVM.

Enable Virto

  • Install virtio-kmod:
cd /usr/ports/emulators/virtio-kmod && make clean install
  • When prompted on each required package, accept defaults and OK.
  • Copy the virtio modules into /boot/kernel directory:
cp -Rp /usr/local/modules/* /boot/kernel/
kldxref /boot/kernel
  • Add the following to /boot/loader.conf:
virtio_load="YES"
virtio_pci_load="YES"
virtio_blk_load="YES"
if_vtnet_load="YES"
virtio_balloon_load="YES"
  • Enable virtio for disk by changing your /etc/fstab entries to use the vtbd prefix. Example:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/vtbd0p2    /               ufs     rw      1       1
/dev/vtbd0p3    none            swap    sw      0       0
  • Enable virtio for network by changing the ifconfig_em0="DHCP" line in /etc/rc.conf to:
ifconfig_vtnet0="DHCP"
  • Shutdown the VM
shutdown -p now
  • Change network and disk drivers to virtio.
  • Power on the VM.
  • Verify that virtio is loading:
kldstat

Id Refs Address            Size     Name
 1   12 0xffffffff80200000 11cdab0  kernel
 2    5 0xffffffff813ce000 4ca0     virtio.ko
 3    1 0xffffffff813d3000 5880     virtio_pci.ko
 4    1 0xffffffff813d9000 5010     virtio_blk.ko
 5    1 0xffffffff813df000 aeb0     if_vtnet.ko
 6    1 0xffffffff813ea000 3210     virtio_balloon.ko

External Links