TechBuzzPro

How to Set Up Bluetooth on FreeBSD: A Practical Guide

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Bluetooth support on FreeBSD is not enabled out of the box on most installations, but it is fully supported once you load the right kernel modules and start the right services. In short: load the ng_ubt kernel module (or build it into your kernel), enable the dbus and bluetooth services in rc.conf, start hcid and sdpd, then pair your device with bluetooth-config or hccontrol. This guide walks through that process on a standard FreeBSD 13 or 14 system with a USB Bluetooth adapter, and explains what to do when a device will not pair. Menu and command names can differ slightly between FreeBSD versions, so check the man pages for your release if something does not match.

What You'll Need

  • A FreeBSD system (13.x or 14.x recommended) with root or sudo access.
  • A Bluetooth adapter. USB dongles are the most reliable; many laptops have internal adapters that also work, but check usbconfig or pciconf to confirm the chipset is recognised.
  • The bluez-utils port or package is not used on FreeBSD; the native stack lives in the base system, so no extra Bluetooth package is required.
  • An internet connection if you need to install any helper tools such as bluetooth-config (part of the base system on recent releases, but confirm with pkg search).

Step-by-Step

  1. Confirm the adapter is detected. Run usbconfig for USB dongles or pciconf -lv for internal adapters. You should see a Bluetooth device listed. If nothing appears, the hardware is not being recognised and no software step will help until that is resolved.
  2. Load the Bluetooth kernel module. As root, run kldload ng_ubt for a USB adapter. To make it load at boot, add ng_ubt_load="YES" to /boot/loader.conf. For some laptop chipsets you may also need ng_bluetooth and netgraph; these are usually pulled in automatically.
  3. Enable the required services. Edit /etc/rc.conf and add:
    dbus_enable="YES"
    bluetooth_enable="YES"
    hcid_enable="YES"
    sdpd_enable="YES"
    Save the file.
  4. Start the services now without rebooting: service dbus start, then service bluetooth start, then service hcid start, then service sdpd start. Check each returns without error.
  5. Verify the stack is running. Run hccontrol -n ubt0hci read_bd_addr. If it prints a MAC address, the controller is up and talking to the stack.
  6. Make the adapter discoverable so your phone, headset or keyboard can find it: hccontrol -n ubt0hci write_scan_enable 3. This turns on inquiry and page scan.
  7. Scan for nearby devices. Use hccontrol -n ubt0hci inquiry. Wait up to 30 seconds; nearby devices appear with their MAC addresses. Note the address of the device you want.
  8. Pair the device. The simplest route on recent FreeBSD is bluetooth-config scan followed by bluetooth-config pair <address>, which handles the PIN exchange for you. If bluetooth-config is unavailable, use hccontrol -n ubt0hci create_connection <address> and enter the PIN when prompted.
  9. Trust the device so it reconnects automatically: hccontrol -n ubt0hci write_link_policy <address> 0x0005. This sets the link policy to allow role switch and hold mode, which most peripherals expect.
  10. Test it. For a headset, check sdpd is running and that the audio device appears in mixer or your sound server. For input devices such as keyboards and mice, the device should appear in /dev/input or as an ums/ukbd node. If it does not, see Troubleshooting below.

Common Mistakes

  • Forgetting to add the services to rc.conf, so everything works until the next reboot and then silently stops.
  • Loading ng_ubt but not starting dbus; many Bluetooth tools depend on D-Bus being up first.
  • Assuming Linux tools like bluetoothctl work on FreeBSD. They do not; the native stack uses hccontrol, hcsecd and bluetooth-config.
  • Pairing without making the adapter discoverable first, so the remote device never sees it.
  • Leaving the adapter in discoverable mode permanently, which is a minor security and battery concern. Turn scan off with write_scan_enable 0 when done.

Tips

  • Keep a note of the MAC addresses of your paired devices; re-pairing is faster when you already know the address.
  • If you use a laptop with a combined Wi-Fi/Bluetooth chipset, check that the Wi-Fi driver is loaded first; some chips only expose Bluetooth after the wireless interface is up.
  • Use dmesg after plugging in a dongle to confirm the kernel attached the device as ubt0.
  • For audio, confirm your sound stack (OSS, PulseAudio or sndio) is configured to accept the Bluetooth sink before blaming the Bluetooth stack.

Troubleshooting

If hccontrol reports that no controller is found, the module is not loaded or the adapter is not attached. Run kldstat | grep ubt and usbconfig again. If the module is loaded but no device appears, try a different USB port or a powered hub; some dongles draw more current than a single port provides.

If pairing fails with an authentication error, remove the device from both sides and start over. On the FreeBSD side, hccontrol -n ubt0hci delete_stored_link_key <address> clears the stored key. On the phone or headset, use its own menu to forget the device.

If the device pairs but does not work, check that sdpd is running and that the relevant profile is supported. FreeBSD's stack covers HID (keyboards, mice), audio (A2DP and HFP via sbc and related tools) and serial (SPP), but not every proprietary profile. If your device needs a vendor-specific profile, it may simply not be supported.

If everything works until reboot, re-check /etc/rc.conf and /boot/loader.conf line by line. A single typo in a service name means it silently fails to start.

Frequently Asked Questions

Does FreeBSD support Bluetooth out of the box?

The kernel modules and userland tools are in the base system, but the services are disabled by default. You have to load ng_ubt and enable dbus, bluetooth, hcid and sdpd.

Can I use bluetoothctl on FreeBSD?

No. bluetoothctl is part of BlueZ, which is Linux-specific. FreeBSD uses hccontrol, hcsecd and bluetooth-config instead.

Why does my adapter not appear after kldload?

Either the chipset is not supported by ng_ubt, or the USB device did not attach. Check dmesg and usbconfig; some very new or very cheap dongles need a different driver.

Can I pair a Bluetooth headset for audio?

Yes, A2DP and HFP are supported through the native stack, but you also need a sound server or OSS configuration that accepts the Bluetooth sink. Pairing alone does not route audio.

How do I stop the adapter being discoverable?

Run hccontrol -n ubt0hci write_scan_enable 0. This disables inquiry and page scan until you turn it back on.

Do I need to reinstall anything after a FreeBSD upgrade?

Usually not, but re-check rc.conf and loader.conf after a major version upgrade; service names and module names occasionally change, and the release notes will say so.