This guide walks you through the process of connecting to a Bluetooth device on a Linux system using the bluetoothctl
command-line tool. It covers initial setup, scanning, pairing, and connecting procedures, along with troubleshooting tips.
- A Linux distribution with Bluetooth support (e.g., Arch Linux).
- The
bluez
package installed, which providesbluetoothctl
and related utilities. - A working Bluetooth adapter installed on your system.
- Sudo privileges to execute commands that require root access.
First, ensure that the Bluetooth service is running and your system recognizes the Bluetooth adapter.
sudo systemctl status bluetooth
- If the service isn’t active, start it:
sudo systemctl start bluetooth
- Enable the service on boot:
sudo systemctl enable bluetooth
sudo bluetoothctl list
- This command should list one or more controllers. For example:
Controller 98:83:89:D8:70:52 archlinux [default]
- If no controller is listed, verify hardware connections, enable Bluetooth in BIOS/UEFI, and check for necessary drivers.
rfkill list bluetooth
- If the output shows that Bluetooth is blocked, unblock it:
sudo rfkill unblock bluetooth
Start the Bluetooth control tool and prepare your adapter for scanning and pairing.
sudo bluetoothctl
You will enter the interactive prompt [bluetooth]#
.
- List Controllers:
[bluetooth]# list
- Select the Default Controller (if not already selected):
Replace[bluetooth]# select <MAC-address>
<MAC-address>
with your controller’s MAC address, e.g.,98:83:89:D8:70:52
. - Power On the Controller:
You should see a confirmation like[bluetooth]# power on
Changing power on succeeded
.
To handle pairing requests:
[bluetooth]# agent on
[bluetooth]# default-agent
Optionally, make your device discoverable:
[bluetooth]# discoverable on
Now that your adapter is powered on, start scanning for nearby Bluetooth devices.
[bluetooth]# scan on
- The adapter will begin scanning, and you will see output lines for every device discovered:
[NEW] Device 7D:2B:B5:6A:02:78 Device_Name
When you have identified the device you want:
[bluetooth]# scan off
With the device discovered, proceed to pair, trust, and connect.
[bluetooth]# devices
- This command lists all known devices with their MAC addresses and names.
Choose the device you want to interact with:
[bluetooth]# select <Device-MAC>
Replace <Device-MAC>
with the MAC address of the target device.
[bluetooth]# pair <Device-MAC>
- Follow any on-screen prompts. Some devices may require a PIN confirmation or acceptance.
To allow automatic reconnections in the future:
[bluetooth]# trust <Device-MAC>
[bluetooth]# connect <Device-MAC>
- The device should now connect. If it’s an audio device, additional configuration for audio services (like PulseAudio or BlueALSA) may be needed.
To view details about a connected or known device:
[bluetooth]# info <Device-MAC>
If you want to remove a paired device from the list:
[bluetooth]# remove <Device-MAC>
When finished:
[bluetooth]# quit
If you encounter issues during the process:
Within bluetoothctl
, verify adapter details:
[bluetooth]# show
- Confirm
Powered: yes
and appropriate discoverability settings.
hciconfig -a
- Ensure the interface (e.g.,
hci0
) isUP
andRUNNING
. If not, bring it up:sudo hciconfig hci0 up
dmesg | grep -i bluetooth
- Look for driver or hardware errors.
On Arch Linux, update your system:
sudo pacman -Syu
- Check for updated drivers or firmware for your specific Bluetooth adapter.