Bluetooth is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is BlueZ.
- 1 Installation
- 2 Pairing
- 3 Configuration
- 4 Audio
- 5 Bluetooth serial
- 6 Troubleshooting
- 6.1 Debugging
- 6.2 Deprecated BlueZ tools
- 6.3 gnome-bluetooth
- 6.4 Bluetooth USB Dongle
- 6.5 Logitech Bluetooth USB Dongle
- 6.6 hcitool scan: Device not found
- 6.7 bluetoothctl: No default controller available
- 6.8 rfkill unblock: Do not unblock
- 6.9 My computer is not visible
- 6.10 Logitech keyboard does not pair
- 6.11 HSP/HFP profiles
- 6.12 Foxconn / Hon Hai / Lite-On Broadcom device
- 6.13 Intel combined wifi and bluetooth cards
- 6.14 Device connects, then disconnects after a few moments
- 6.15 Device does not connect with an error in journal
- 6.16 Device does not show up in scan
- 6.17 Interference between Headphones and Mouse
- 6.18 Bluetooth mouse laggy movements
- 6.19 Adapter disappears after suspend/resume
- Install the package, providing the Bluetooth protocol stack.
- Install the package, providing the
bluetoothctlutility. Alternatively install AUR to additionally have the deprecated BlueZ tools.
- The generic Bluetooth driver is the
btusbKernel module. Check whether that module is loaded. If it's not, then load the module.
- By default the bluetooth daemon will only give out bnep0 devices to users that are a member of the
lpgroup. Make sure to add your user to that group if you intend to connect to a bluetooth tether. You can change the group that is required in the file
- Some Bluetooth adapters are bundled with a Wi-Fi card (e.g. Intel Centrino). These require that the Wi-Fi card is firstly enabled (typically a keyboard shortcut on a laptop) in order to make the Bluetooth adapter visible to the kernel.
- Some Bluetooth cards (e.g. Broadcom) conflict with the network adapter. Thus, you need to make sure that your Bluetooth device get connected before the network service boot.
- Some tools such as hcitool and hciconfig have been deprecated upstream, and are no longer included in FS#53110 and the Bluez mailing list for more information. . Since these tools will no longer be updated, it is recommended that scripts be updated to avoid using them. If you still desire to use them, install AUR. See
- bluetoothctl — Pairing a device from the shell is one of the simplest and most reliable options.
echo -e "<command1>\n<command2>\n" | bluetoothctlor
bluetoothctl -- command
The following packages allow for a graphical interface to customize Bluetooth.
- GNOME Bluetooth — GNOME's Bluetooth tool.
- provides the back-end
- provides the status monitor applet
provides the configuration front-end GUI that can be accessed by typing Bluetooth on the Activities overview, or with the
- You can also launch the
bluetooth-sendtocommand directly to send files to a remote device.
- AUR adds a "Send via Bluetooth" entry to Nautilus' right-click menu
- To receive files, open the Bluetooth settings panel; you can only receive whilst the Bluetooth panel is open.
- To add a Bluetooth entry to the Send To menu in Thunar's file properties menu, see instructions here. (The command that needs to be configured is
- Bluedevil — KDE's Bluetooth tool. If there is no Bluetooth icon visible in Dolphin and in the system tray, enable it in the system tray options or add a widget. You can configure Bluedevil and detect Bluetooth devices by clicking the icon. An interface is also available from the KDE System Settings.
- Blueberry — Linux Mint's spin-off of GNOME Bluetooth, which works in all desktop environments. Blueberry does not support receiving files through Obex Object Push.
- Blueman — A full featured Bluetooth manager.
- ObexFTP — A tool for transferring files to/from any OBEX enabled device.
This section describes directly configuring bluez5 via the bluetoothctl CLI, which might not be necessary if you are using an alternative front-end tool (such as GNOME Bluetooth).
The exact procedure depends on the devices involved and their input functionality. What follows is a general outline of pairing a device using
bluetoothctl interactive command. Input
help to get a list of available commands.
- (optional) Select a default controller with
power onto turn the power to the controller on. It is off by default and will turn off again each reboot, see #Auto power-on after boot.
devicesto get the MAC Address of the device with which to pair.
- Enter device discovery mode with
scan oncommand if device is not yet on the list.
- Turn the agent on with
agent onor choose a specific agent: if you press tab twice after
agentyou should see a list of available agents, e.g. DisplayOnly KeyboardDisplay NoInputNoOutput DisplayYesNo KeyboardOnly off on.
pair MAC_addressto do the pairing (tab completion works).
- If using a device without a PIN, one may need to manually trust the device before it can reconnect successfully. Enter
trust MAC_addressto do so.
connect MAC_addressto establish a connection.
An example session may look this way:
[NEW] Controller 00:10:20:30:40:50 pi [default]
[bluetooth]# agent KeyboardOnly
Default agent request successful
[bluetooth]# power on
Changing power on succeeded [CHG] Controller 00:10:20:30:40:50 Powered: yes
[bluetooth]# scan on
Discovery started [CHG] Controller 00:10:20:30:40:50 Discovering: yes [NEW] Device 00:12:34:56:78:90 myLino [CHG] Device 00:12:34:56:78:90 LegacyPairing: yes
[bluetooth]# pair 00:12:34:56:78:90
Attempting to pair with 00:12:34:56:78:90 [CHG] Device 00:12:34:56:78:90 Connected: yes [CHG] Device 00:12:34:56:78:90 Connected: no [CHG] Device 00:12:34:56:78:90 Connected: yes Request PIN code [agent] Enter PIN code: 1234 [CHG] Device 00:12:34:56:78:90 Paired: yes Pairing successful [CHG] Device 00:12:34:56:78:90 Connected: no
[bluetooth]# connect 00:12:34:56:78:90
Attempting to connect to 00:12:34:56:78:90 [CHG] Device 00:12:34:56:78:90 Connected: yes Connection successful
Auto power-on after boot
By default, the Bluetooth adapter does not power on after a reboot, you need to add the line
AutoEnable=true in the configuration file
/etc/bluetooth/main.conf at the bottom in the
hciconfig hci0 upis deprecated, see the release note.
Discoverable on startup
If the device should always be visible and directly connectable:
[General] DiscoverableTimeout = 0 Discoverable=true
In order to be able to use audio equipment like bluetooth headphones or speakers, you need to install the additionalpackage. With a default PulseAudio installation you should immediately be able to stream audio from a bluetooth device to your speakers.
If you have a system-wide PulseAudio setup make sure the user running the daemon (usually
pulse) is in the
lp group and you load the bluetooth modules in your PulseAudio config:
... load-module module-bluetooth-policy load-module module-bluetooth-discover ...
See the Bluetooth headset page for more information about bluetooth audio and bluetooth headsets.
To get bluetooth serial communication working on Bluetooth-to-Serial modules (HC-05, HC-06) do the following steps:
Pair your bluetooth device using
bluetoothctl as described above.
InstallAUR and AUR, as they provide certain functionality which is missing from newer tools.
Bind paired device MAC address to tty terminal:
# rfcomm bind rfcomm0 <MAC address of bluetooth device>
Now you can open
/dev/rfcomm0 for serial communication:
picocom /dev/rfcomm0 -b 115200
In order to debug, first stop
And then start it with the
# /usr/lib/bluetooth/bluetoothd -n -d
Another option is via the
Deprecated BlueZ tools
Eight BlueZ tools were deprecated and removed from , although not all of them were superseded by newer tools. The AUR package provides an alternative version of with the deprecated tools.
|Deprecated tool||Most likely replacement|
|gatttool||btgatt-client, D-Bus Gatt API|
|hciconfig||btmgmt (and bluetoothctl?)|
|hcidump||btmon (and btsnoop)|
|hcitool||missing, D-Bus Device API available|
|rfcomm||missing, implement with D-Bus Profile1 API?|
|sdptool||missing, functionality seems to be scattered over different D-Bus objects: Profile, Advertising, and the UUIDs arrays in device and adapter.|
If you see this when trying to enable receiving files in bluetooth-properties:
Bluetooth OBEX start failed: Invalid path Bluetooth FTP start failed: Invalid path
Then make sure that the XDG user directories exist.
Bluetooth USB Dongle
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by running
journalctl -f when you have plugged in the USB dongle (or inspecting
/var/log/messages.log). It should look something like the following (look out for hci):
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd Feb 20 15:00:24 hostname bluetoothd: HCI dev 0 registered Feb 20 15:00:24 hostname bluetoothd: Listening for HCI events on hci0 Feb 20 15:00:25 hostname bluetoothd: HCI dev 0 up Feb 20 15:00:25 hostname bluetoothd: Adapter /org/bluez/4568/hci0 has been enabled
If you only get the first two lines, you may see that it found the device but you need to bring it up. Example:
Index list with 1 item hci0: Primary controller addr 00:1A:7D:DA:71:10 version 6 manufacturer 10 class 0x000000 supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le advertising secure-conn debug-keys privacy static-addr current settings: connectable discoverable bondable ssp br/edr le secure-conn name Mozart short name
[mgmt]# select hci0
Selected index 0
[hci0]# power up
hci0 Set Powered complete, settings: powered connectable discoverable bondable ssp br/edr le secure-conn
hci0: Primary controller addr 00:1A:7D:DA:71:10 version 6 manufacturer 10 class 0x1c0104 supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le advertising secure-conn debug-keys privacy static-addr current settings: powered connectable discoverable bondable ssp br/edr le secure-conn
Controller 00:1A:7D:DA:71:10 (public) Name: Mozart Alias: Mozart Class: 0x0000095c Powered: no Discoverable: yes Pairable: yes
[bluetooth]# power on
[CHG] Controller 00:1A:7D:DA:71:10 Class: 0x001c0104 Changing power on succeeded [CHG] Controller 00:1A:7D:DA:71:10 Powered: yes
Controller 00:1A:7D:DA:71:10 (public) Name: Mozart Alias: Mozart Class: 0x001c0104 Powered: yes Discoverable: yes Pairable: yes
To verify that the device was detected you can use
btmgmt which is part of the
bluez-utils. You can get a list of available devices and their identifiers and their MAC address by issuing:
$ btmgmt info
Index list with 1 item hci0: Primary controller addr 00:1A:7D:DA:71:10 version 6 manufacturer 10 class 0x1c0104 supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le advertising secure-conn debug-keys privacy static-addr current settings: powered connectable discoverable bondable ssp br/edr le secure-conn
It is possible to check the Bluetooth version as mapped to the HCI version according to the table in the official specification. For example, in the previous output, HCI version 6 is Bluetooth version 4.0.
More detailed information about the device can be retrieved by using the deprecated
hciconfig. ( AUR)
$ hciconfig -a hci0
hci0: Type: USB BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:1226 acl:0 sco:0 events:27 errors:0 TX bytes:351 acl:0 sco:0 commands:26 errors:0 Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF PARK Link mode: SLAVE ACCEPT Name: 'BlueZ (0)' Class: 0x000100 Service Classes: Unspecified Device Class: Computer, Uncategorized HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c Manufacturer: Cambridge Silicon Radio (10)
Audio devices start to skip at short distance from dongle
If other devices share the same USB host, they can interrupt communication with audio devices. Make sure it is the only device attached to its bus. For example:
Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 048d:1345 Integrated Technology Express, Inc. Multi Cardreader Bus 001 Device 003: ID 0424:a700 Standard Microsystems Corp. 2 Port Hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
CSR Dongle 0a12:0001
ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) has a regression bug, and currently only works in the kernel version ≤ 3.9.11. There is a patch available for newer versions. For more information, see Kernel Bug 60824.
Logitech Bluetooth USB Dongle
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes: Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that you are using a normal USB mouse/keyoard.
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. Discussion
Alternatively, you can install thepackage. When you connect your Logitech dongle it will automatically switch.
hcitool scan: Device not found
- On some laptops (e.g. Dell Studio 15, Lenovo Thinkpad X1) you have to switch the Bluetooth mode from HID to HCI. Install the udev should do this automatically. Alternatively, you can run this command to switch to HCI manually: package, then
- If the device will not show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.
- Sometimes also this simple command helps:
# bluetoothctl power on
bluetoothctl: No default controller available
This error may happen if the device is blocked by rfkill.
It might also happen with some intel cards (such as the 8260) to not be picked up correctly by the bluetooth service. In some cases, using the deprecatedAUR in lieu of have reportedly fixed the issue.
rfkill unblock: Do not unblock
If your device still soft blocked and you run connman, try this:
$ connmanctl enable bluetooth
My computer is not visible
Cannot discover computer from your phone? Enable discoverable mode:
# bluetoothctl discoverable on
to check if it worked:
# bluetoothctl show
Powered: yes Discoverable: yes Pairable: yes
If even so it does not show up, try changing the device class in
/etc/bluetooth/main.conf as following:
# Default device class. Only the major and minor device class bits are # considered. #Class = 0x000100 (from default config) Class = 0x100100
A user reported that this was the only solution to make his computer visible for his phone.
Logitech keyboard does not pair
If you do not get the passkey when you try to pair your Logitech keyboard, type the following command:
# btmgmt ssp off
If after pairing, the keyboard still does not connect, check the output of
hcidump -at. If the latter indicates repeatedly connections-disconnections like the following message:
status 0x00 handle 11 reason 0x13 Reason: Remote User Terminated Connection
then, the only solution for now is to install the old Bluetooth stack.
Foxconn / Hon Hai / Lite-On Broadcom device
Some of these devices require the firmware to be flashed into the device at boot. The firmware is not provided but can converted from a Microsoft Windows .hex file into a .hcd using hex2hcd (which is installed with ).
In order to get the right .hex file, try searching the device vendor:product code obtained with lsusb, for example:
... Bus 002 Device 004: ID 04ca:2006 Lite-On Technology Corp. Broadcom BCM43142A0 Bluetooth Device ...
Bus 004 Device 004: Id 0489:e031 Foxconn / Hon Hai
Alternatively, boot into Windows (a virtual machine installation will suffice) and get the firmware name from the Device Manager utility. If you want to know the model of your device but cannot see it in lsusb, you might see it in lsusb -v as
The .hex file can be extracted from the downloaded Windows driver without having to run Windows for it. Download the right driver, for example Bluetooth Widcomm (listed among the drivers for Lifebook P771), which contains the drivers for many Broadcomm devices. In case of Bluetooth Widcomm, the driver is a self-extracting RAR archive, so it can be extracted using x. To find out which of the many .hex files is the right one for you, look in the file
Win32/bcbtums-win7x86-brcm.inf and search for
E031 should be replaced with the product code (the second hex number in lsusb) of your device in upper-case. Underneath you should see the file name of the right .hex file.
Once you have the .hcd file, copy it into
/lib/firmware/brcm/BCM.hcd - this filename is suggested by
dmesg and it may change in your case so check your dmesg output in order to verify. Then reload the btusb module:
# rmmod btusb # modprobe btusb
The device should now be available. See BBS#162688 for information on making these changes persistent.
Intel combined wifi and bluetooth cards
Device connects, then disconnects after a few moments
If you see messages like the following in
journalctl output, and your device fails to connect or disconnects shortly after connecting:
bluetoothd: Unable to get connect data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107) bluetoothd: connect error: Connection refused (111)
This may be because you have already paired the device with another operating system using the same bluetooth adapter (e.g., dual-booting). Some devices cannot handle multiple pairings associated with the same MAC address (i.e., bluetooth adapter). You can fix this by copying the pairing keys from the other OS. Start by removing the device:
Device XX:XX:XX:XX:XX:XX My Device
[bluetooth]# remove XX:XX:XX:XX:XX:XX
Then reset the device. Now pair the device again. Then reboot into the other OS and pair the device. Now you need to extract the pairing keys. Switch off the bluetooth devices and then follow these instructions to extract the pairing keys.
- For Windows:
Reboot into Arch. Switch of your Bluetooth devices, to prevent connection attempts.
Mount your windows system drive.
$ cd /path/to/winddows/drive/Windows/System32/config
# chntpw -e SYSTEM
run these commands:
> cd CurrentControlSet\Services\BTHPORT\Paramters\Keys
> ls #prints your Bluetooth adapter's MAC address
> cd <mac_addr> #<mac_addr> is the MAC address from the previous command
> ls #lists all paired devices' MAC address
Node has 0 subkeys and 1 values size type value name [value if type DWORD] 16 REG_BINARY <123456789876>
> hex 123456789876
:00000 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX (some other chars)
These "XX"s are the pairing key. Make note of which keys map to which MAC addresses. Now continue with the instructions below.
- For macOS
Boot into macOS. Then open a terminal.
If you are on Sierra or older, run
$ sudo defaults read /private/var/root/Library/Preferences/blued.plist LinkKeys > ~/bt_keys.txt
If you are on High Sierra or newer, run
$ sudo defaults read /private/var/root/Library/Preference/com.apple.bluetoothd.plist LinkKeys > ~/bt_keys.txt
bt_keys.txt file to a drive that can be read from archlinux.
- Now that you have the keys
Boot into archlinux, and run the following
# cd /var/lib/bluetooth/[BT Adapter MAC address]
Here you will find folders for each paired bluetooth device. For each device you want to pair with arch and your dual boot, do the following
# cd [device MAC address]
info file and change the key under
You will have to make sure that all the letters are in capital case. Remove any spaces. Note that for older versions of macOS (High Sierra and older) you will have to reverse the key like so:
98 54 2f aa bb cc dd ee ff gg hh ii jj kk ll mm becomes
MM LL KK JJ GG FF EE DD CC BB AA 2F 54 98. This reversal is not necessary for newer versions of macOS.
bluetooth.service, turn on your bluetooth adapter, make your device discoverable, re-scan for devices, and re-pair your device. Depending on your bluetooth manager, you may need to perform a full reboot in order to re-discover the device.
Device does not connect with an error in journal
If you see a message like the following in
journalctl output while trying to connect to a device:
a2dp-source profile connect failed for 9C:64:40:22:E1:3F: Protocol not available
try installing PulseAudio. This error can manifest even while using only file transfer.and restarting
Device does not show up in scan
Some devices using bluetooth low energy do not appear when scanning with bluetoothctl, for example the Logitech MX Master. The simplest way I have found to connect them is by installing start
bluetooth.service and do:
[NEW] Controller (MAC) myhostname [default]
[bluetooth]# power on
[CHG] Controller (MAC) Class: 0x0c010c Changing power on succeeded [CHG] Controller (MAC) Powered: yes
[bluetooth]# scan on
Discovery started [CHG] Controller (MAC) Discovering: yes
In another terminal:
# hcitool lescan
Wait until your device shows up, then
Ctrl+c hcitool. bluetoothctl should now see your device and pair normally.
Interference between Headphones and Mouse
If you experience audio stuttering while using a bluetooth mouse and keyboard simultaneously, you can try the following as referenced in #23 https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/424215
# hciconfig hci0 lm ACCEPT,MASTER # hciconfig hci0 lp HOLD,SNIFF,PARK
Bluetooth mouse laggy movements
Try edit the file
XX:XX:XX:XX:XX:XX - your Bluetooth adapter MAC-address,
YY:YY:YY:YY:YY:YY - your mouse MAC-address) and add those lines:
[ConnectionParameters] MinInterval=6 MaxInterval=9 Latency=44 Timeout=216
You can see your local adapter MAC address by running command
hcitool dev, your can see MAC addresses of currently connected remote devices by running command
Adapter disappears after suspend/resume
First, find vendor and product ID of the adapter. For example:
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub ... |__ Port 3: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M ID 8087:0025 Intel Corp. |__ Port 3: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M ID 8087:0025 Intel Corp. ...
In this case, the vendor ID is 8087 and the product ID is 0025.
Then, useto reset the adapter:
# usb_modeswitch -R -v <vendor ID> -p <product ID>