FreeBSD network tuning for KVM

ifconfig_vtnet0="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx -rxcsum -txcsum -rxcsum6 -txcsum6 -lro -tso"

The above line is taken from /etc/rc.conf. “vtnet0” is the interface description for a virtIO device, on Hyper-V it is named “hn0”.

-rxcsum-/txcsum: disable Rx/Tx Checksum Offloading
-lro: disable TCP Large Receive Offloading
-tso: disable TCP Segmentation Offloading

The parameters above disable hardware offloading to the network card, this may increase CPU usage but some cards are simply not powerful enough to handle high traffic and some hypervisors are not 100% compatible with these settings.

NTPd does not start on FreeBSD 12.0

NTPd quits with following error:

Starting ntpd.
su: unknown login: ntpd
/etc/rc.d/ntpd: WARNING: failed to start ntpd

Just enter following commands to rebuild master password database and remove old ntpd.pid file:

# /usr/sbin/pwd_mkdb -p /etc/master.passw
# pkill ntpd
# rm /var/db/ntp/ntpd.pid
# service ntpd start

Use virt-viewer from OSX to connect to remote KVM on Centos 7

Here a simple howto to prepare the connection:

  • Install MacPorts
  • Insrall XQuartz
  • Install virt-viewer
    # sudo port install virt-viewer
  • Create SSH id on OSX (used for passwordless login)
    # ssh-keygen
  • Then copy this key to your remote server (~/.ssh/id_XXX.pub)
    # ssh-copy-id root@server.machine

Now you can connect with the following URL:

# virt-viewer -c qemu+ssh://root@server.machine/system?socket=/var/run/libvirt/libvirt-sock