Project

General

Profile

To check how much network a bhyve virtual machine is using

User documentation
26/02/2026

To check how much network a bhyve virtual machine is using, you need to monitor the virtual network interface (tap device) on the FreeBSD host, as bhyve connects the VM's vtnet interface to a tap interface on the host.
FreeBSD
FreeBSD
+1
Here are the methods to monitor network usage:

  1. Identify the TAP Device
    First, find which tap device corresponds to your VM. If you are using vm-bhyve, run:
    bash
    vm switch list
    If not using vm-bhyve, you can check which tap device is bridged to your virtual network by inspecting ifconfig output, looking for bridged interfaces.
    FreeBSD
    FreeBSD
    +1
  2. Real-time Monitoring (Top/Ifstat)
    Use standard FreeBSD tools on the host to monitor traffic on the tap interface (e.g., tap0):
    netstat -I tap0 -h 1: Displays statistics for tap0 every 1 second.
    ifstat -i tap0: Provides a cleaner, running count of bytes per second.
    bwm-ng: If installed (pkg install bwm-ng), this provides a nice ncurses-based terminal graph.
    www.sharpwriting.net
    www.sharpwriting.net
  3. Using vm-bhyve
    If you are managing VMs with vm-bhyve, you can get detailed information about the virtual switch and the interfaces connected to it:
    bash
    vm switch info <switch_name>
    This shows the tap interface assigned to each VM.
    www.gsp.com
    www.gsp.com
  4. Inside the Guest (Optional)
    You can also run traditional network monitoring tools (like nload, iftop, or ifconfig) inside the guest VM to see vtnet0 traffic.
    blog.socruel.nu
    blog.socruel.nu
    +3
  5. Advanced Monitoring (Prometheus)
    For persistent monitoring, using prometheus-node-exporter on the host to monitor the tap interfaces is the recommended approach for FreeBSD VMs.

Files