Skip to content

Instantly share code, notes, and snippets.

@aidos-dev
Last active November 20, 2025 05:48
Show Gist options
  • Select an option

  • Save aidos-dev/b49078c1d8c6bb1621e4ac199d18213b to your computer and use it in GitHub Desktop.

Select an option

Save aidos-dev/b49078c1d8c6bb1621e4ac199d18213b to your computer and use it in GitHub Desktop.
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf

The terminal will ask you to input your password. Please type it :)

Step 2.

After that a file with configurations will be opened in a terminal window.

Find the next line:

#ControllerMode = dual

Step 3.

Change "dual" to "bredr". The final code must be:

ControllerMode = bredr

Step 4.

To save changes and exit nano editor do the following:

  1. On your keyboard press:
Ctrl + x
  1. On the bottom of nano editor you will see a qustion:

"Save modified buffer?"

  1. Press on your keyboard: y
  2. Press on your keyboard: Enter

After these steps you will come back to regular terminal window on the same directory as before.

Step 5.

Run the next command in a terminal:

sudo /etc/init.d/bluetooth restart

After that you will see the message:

"Restarting bluetooth (via systemctl): bluetooth.service."

Step 6.

Go to your computer settings and enable Bluetooth so it starts to look for bluetooth connections

Step 7.

The next actions should be performed exactly as described:

  1. Put your airpods (both) inside the case

  2. Keep the cover opened

  3. With cover opened and airpods inside the case press and hold the button on the back of the airpods case.

  4. Hold the button until you see the light blinking on the front side of the case, it can also make a sound signaling that it is in pairing mode

Step 8.

Finaly, after all these steps you should find your AirPods on Bluetooth settings section and connect it ;)

@jjjllxx
Copy link

jjjllxx commented Nov 28, 2024

This is really clear and useful! Thanks a lot!

@frankiejav
Copy link

awesome thank you

@Srujan-D
Copy link

thank you!!

@adhillon192
Copy link

adhillon192 commented Jan 16, 2025

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Changing #ControllerMode = dual to ControllerMode = dual works for me.
ControllerMode = bredr does not work for me.

ControllerMode = dual - works for me with Logitech MX devices and AirPods, but only as output device, its microphone is not available to set as Input :( I'm on Ubuntu 20.04.6 LTS.

Update:

* First, I changed `#ControllerMode = dual` to `ControllerMode = bredr` and suddenly when I restarted Bluetooth service with `sudo /etc/init.d/bluetooth restart` I was finally able to pair my AirPods (1st gen)! However all my Logitech MX devices got disconnected.

* Second, I decided to change `ControllerMode = bredr` to `ControllerMode = dual` to be able to connect my Logitech MX devices. And VOILÀ - my AirPods and MX devices are connected via Bluetooth to my laptop.

* Third, I followed [this guide on AskUbuntu](https://askubuntu.com/a/1339898) to make the AirPods microphone work as my input device. Unfortunately, I need to switch the Input in Settings to AirPods microphone but the Output switches to mSBC codec (HSP/HFP) automatically, so my earphones doesn't give me high quality sound on meetings :(
  Luckily I can switch to A2DP codec (High Fidelity Playback) as the Output and high quality sound gets back but only output! Hence I need to remember whether I am on a call or watching YouTube to switch between this options in Settings.

* * Handsfree: lower quality but both input/output

* * Headset: high quality but only output

Maybe somebody has managed to use both the A2DP (High Fidelity Playback) as the Output and AirPods microphone as the Input?

I am stuck on using the HSP/HFP even if I change the 'ControllerMode' to either 'bredr' or'dual'. Any reason I am not able to force them to use the A2DP as Output?

@s-chizhik
Copy link

Works perfectly on my Linux Mint 22.1

thx a lot mate!

@franco-viotti
Copy link

Thanks! It works on Ubuntu 24.04.1 LTS with AirPods Pro 2

@MaxDobbs32
Copy link

Works immediately! Thank you tremendously!

@5byuri
Copy link

5byuri commented Mar 11, 2025

Worked for me too! Thanks a lot!

@Cyber3x
Copy link

Cyber3x commented Apr 27, 2025

Helped me on 22.04 LTS as well, thanks!

@name2965
Copy link

Nice guide Thanks! It's work in Kali linux :)

@nipunTharuksha
Copy link

Thanks a lot. working with Ubuntu 23.10

@Dinesht04
Copy link

Thank You!

@julianaconsolati
Copy link

Thank you!

@kv4nt
Copy link

kv4nt commented Aug 13, 2025

Thank you!

@furkanunl11
Copy link

Thanks.

@MicrosoftWorks
Copy link

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Changing #ControllerMode = dual to ControllerMode = dual works for me.
ControllerMode = bredr does not work for me.

ControllerMode = dual - works for me with Logitech MX devices and AirPods, but only as output device, its microphone is not available to set as Input :( I'm on Ubuntu 20.04.6 LTS.
Update:

* First, I changed `#ControllerMode = dual` to `ControllerMode = bredr` and suddenly when I restarted Bluetooth service with `sudo /etc/init.d/bluetooth restart` I was finally able to pair my AirPods (1st gen)! However all my Logitech MX devices got disconnected.

* Second, I decided to change `ControllerMode = bredr` to `ControllerMode = dual` to be able to connect my Logitech MX devices. And VOILÀ - my AirPods and MX devices are connected via Bluetooth to my laptop.

* Third, I followed [this guide on AskUbuntu](https://askubuntu.com/a/1339898) to make the AirPods microphone work as my input device. Unfortunately, I need to switch the Input in Settings to AirPods microphone but the Output switches to mSBC codec (HSP/HFP) automatically, so my earphones doesn't give me high quality sound on meetings :(
  Luckily I can switch to A2DP codec (High Fidelity Playback) as the Output and high quality sound gets back but only output! Hence I need to remember whether I am on a call or watching YouTube to switch between this options in Settings.

* * Handsfree: lower quality but both input/output

* * Headset: high quality but only output

Maybe somebody has managed to use both the A2DP (High Fidelity Playback) as the Output and AirPods microphone as the Input?

I am stuck on using the HSP/HFP even if I change the 'ControllerMode' to either 'bredr' or'dual'. Any reason I am not able to force them to use the A2DP as Output?

I know the Manjaro and/or Arch Docs and/or Wikis have tutorials on how to do this. I had done this before to a couple of *nix variants, though lost the info in a thumbdrive. accident (funny story on the data loss: windows 10 isn't funny...)

I'll be looking around here a bit as I recently needed to do the same from this accident. I finally got tired of it picking at random and am now focused on this task. I'll report back with what scrambled adventures I gather!

@MicrosoftWorks
Copy link

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Changing #ControllerMode = dual to ControllerMode = dual works for me.
ControllerMode = bredr does not work for me.

ControllerMode = dual - works for me with Logitech MX devices and AirPods, but only as output device, its microphone is not available to set as Input :( I'm on Ubuntu 20.04.6 LTS.
Update:

* First, I changed `#ControllerMode = dual` to `ControllerMode = bredr` and suddenly when I restarted Bluetooth service with `sudo /etc/init.d/bluetooth restart` I was finally able to pair my AirPods (1st gen)! However all my Logitech MX devices got disconnected.

* Second, I decided to change `ControllerMode = bredr` to `ControllerMode = dual` to be able to connect my Logitech MX devices. And VOILÀ - my AirPods and MX devices are connected via Bluetooth to my laptop.

* Third, I followed [this guide on AskUbuntu](https://askubuntu.com/a/1339898) to make the AirPods microphone work as my input device. Unfortunately, I need to switch the Input in Settings to AirPods microphone but the Output switches to mSBC codec (HSP/HFP) automatically, so my earphones doesn't give me high quality sound on meetings :(
  Luckily I can switch to A2DP codec (High Fidelity Playback) as the Output and high quality sound gets back but only output! Hence I need to remember whether I am on a call or watching YouTube to switch between this options in Settings.

* * Handsfree: lower quality but both input/output

* * Headset: high quality but only output

Maybe somebody has managed to use both the A2DP (High Fidelity Playback) as the Output and AirPods microphone as the Input?

I am stuck on using the HSP/HFP even if I change the 'ControllerMode' to either 'bredr' or'dual'. Any reason I am not able to force them to use the A2DP as Output?

I know the Manjaro and/or Arch Docs and/or Wikis have tutorials on how to do this. I had done this before to a couple of *nix variants, though lost the info in a thumbdrive. accident (funny story on the data loss: windows 10 isn't funny...)

I'll be looking around here a bit as I recently needed to do the same from this accident. I finally got tired of it picking at random and am now focused on this task. I'll report back with what scrambled adventures I gather!

OKAY! Here's what I got:

@adhillon192 -> not sure if ya still need it, but here's to anyone else confused and also suffering from pineal blockages from sorcerers casting dumbfound spells upon us, all while the bluetooth deity laughs at our misfortunes...

https://wiki.archlinux.org/title/Bluetooth_headset#Disable_PipeWire_HSP/HFP_profile contains a great deal of info about A2DP, how to get pipewire to connect to A2DP, how to make A2DP default, as well as other general information regarding making Airpods Max/Pro/ any headset really sound much better via high quality bluetooth x-mit magic, or the like...!

A caveat is that this info is for my current distro, though I believe the info will also help others. I think Ubuntu and others use .lua scripts for pipewire config (?) though I only copy/pasted any tutorials then as this was during my dope ages as a nix user. I wouldn't say I'm quite grown out of them, actually; yet, I'll DEFINITELY remember this sht, hopefully, as it was a pain. I feel for the new user who can't simply plug-n-play their $12, proof of capitalist failure via human rights violation, penny-salaried labor produced headsets from amazon or walmart. I understand that many of us do not want or need such settings exposed or enabled, but it'd be nice if the start guides, for example Arch or Manjaro, included some sort of 'paths' a user can take to either customize their system and learn the components around it, or use a custom installer of such to allow ease of access in following such documentations and tutorials which explain component concepts and setup, some pitfalls, etc... OR BOTH! SOMETHING FOR THE LOVE OF ALL THE MANY MANY LANDFILL-IN-UTAH-LOCATED, BURIED-BY-APPLE, APPLE LISA COMPUTERS!!

anyway, good luck to y'all!

@adhillon192
Copy link

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Changing #ControllerMode = dual to ControllerMode = dual works for me.
ControllerMode = bredr does not work for me.

ControllerMode = dual - works for me with Logitech MX devices and AirPods, but only as output device, its microphone is not available to set as Input :( I'm on Ubuntu 20.04.6 LTS.
Update:

* First, I changed `#ControllerMode = dual` to `ControllerMode = bredr` and suddenly when I restarted Bluetooth service with `sudo /etc/init.d/bluetooth restart` I was finally able to pair my AirPods (1st gen)! However all my Logitech MX devices got disconnected.

* Second, I decided to change `ControllerMode = bredr` to `ControllerMode = dual` to be able to connect my Logitech MX devices. And VOILÀ - my AirPods and MX devices are connected via Bluetooth to my laptop.

* Third, I followed [this guide on AskUbuntu](https://askubuntu.com/a/1339898) to make the AirPods microphone work as my input device. Unfortunately, I need to switch the Input in Settings to AirPods microphone but the Output switches to mSBC codec (HSP/HFP) automatically, so my earphones doesn't give me high quality sound on meetings :(
  Luckily I can switch to A2DP codec (High Fidelity Playback) as the Output and high quality sound gets back but only output! Hence I need to remember whether I am on a call or watching YouTube to switch between this options in Settings.

* * Handsfree: lower quality but both input/output

* * Headset: high quality but only output

Maybe somebody has managed to use both the A2DP (High Fidelity Playback) as the Output and AirPods microphone as the Input?

I am stuck on using the HSP/HFP even if I change the 'ControllerMode' to either 'bredr' or'dual'. Any reason I am not able to force them to use the A2DP as Output?

I know the Manjaro and/or Arch Docs and/or Wikis have tutorials on how to do this. I had done this before to a couple of *nix variants, though lost the info in a thumbdrive. accident (funny story on the data loss: windows 10 isn't funny...)
I'll be looking around here a bit as I recently needed to do the same from this accident. I finally got tired of it picking at random and am now focused on this task. I'll report back with what scrambled adventures I gather!

OKAY! Here's what I got:

@adhillon192 -> not sure if ya still need it, but here's to anyone else confused and also suffering from pineal blockages from sorcerers casting dumbfound spells upon us, all while the bluetooth deity laughs at our misfortunes...

https://wiki.archlinux.org/title/Bluetooth_headset#Disable_PipeWire_HSP/HFP_profile contains a great deal of info about A2DP, how to get pipewire to connect to A2DP, how to make A2DP default, as well as other general information regarding making Airpods Max/Pro/ any headset really sound much better via high quality bluetooth x-mit magic, or the like...!

A caveat is that this info is for my current distro, though I believe the info will also help others. I think Ubuntu and others use .lua scripts for pipewire config (?) though I only copy/pasted any tutorials then as this was during my dope ages as a _nix user. I wouldn't say I'm quite grown out of them, actually; yet, I'll DEFINITELY remember this sh_t, hopefully, as it was a pain. I feel for the new user who can't simply plug-n-play their $12, proof of capitalist failure via human rights violation, penny-salaried labor produced headsets from amazon or walmart. I understand that many of us do not want or need such settings exposed or enabled, but it'd be nice if the start guides, for example Arch or Manjaro, included some sort of 'paths' a user can take to either customize their system and learn the components around it, or use a custom installer of such to allow ease of access in following such documentations and tutorials which explain component concepts and setup, some pitfalls, etc... OR BOTH! SOMETHING FOR THE LOVE OF ALL THE MANY MANY LANDFILL-IN-UTAH-LOCATED, BURIED-BY-APPLE, APPLE LISA COMPUTERS!!

anyway, good luck to y'all!

@MicrosoftWorks I enjoyed reading the last paragraph there. I switched to Ubuntu 25.04 and that seems to have done the trick. Nonetheless I appreciate you putting in the work on this.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment