Hello
Thank you for posting in Microsoft Community forum.
You might need to manually edit the registry to fix the Bluetooth pairing issue. This involves copying the Bluetooth pairing keys from Linux to Windows.
Here's a simplified version of the process:
- Pair the device in Linux and note the MAC address.
- Install chntpw in Linux to access Windows registry keys: sudo apt-get install chntpw
- Access Windows System Drive in Linux and navigate to the Bluetooth registry keys: cd /[MountedDrive]/Windows/System32/config sudo chntpw -e SYSTEM cd \ControlSet001\Services\BTHPORT\Parameters\Keys ****
- Copy the pairing key from Windows and paste it into the corresponding file in Linux: sudo nano /var/lib/bluetooth/[Unique ID]/[MAC Address]/info ****
- Restart Bluetooth service in Linux: sudo service bluetooth restart
Additional Tips:
- BIOS Update: Sometimes, updating the BIOS can resolve hardware compatibility issues.
- Check for Interference: Ensure there are no other devices causing interference with your Bluetooth signal.
Best Regards,
Wesley Li
Hello everyone, I am having the issue where I can not connect my bluetooth headphone in Linux and windows as well, previously I use only Linux and everything works fine.
But recently, because of works, I have to install windows to use it, but then all my bluetooth devices are not usuable. I tried to google the solution, but most of them are about how to make it not have to repair everytime ( I don't mind that actually ). There is no post talking about bluetooth devices can not be connected on both OSes.
So please help me, thanks!
Note: My headphones is normal, I can connect it normally on my phone and everything works so it's the computer's problem.
Update:
I did see this problem
```
sudo service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor pre>
Active: active (running) since Sun 2024-03-03 14:17:38 +07; 1h 0min ago
Docs: man:bluetoothd(8)
Main PID: 741 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 18592)
Memory: 2.0M
CPU: 92ms
CGroup: /system.slice/bluetooth.service
└─741 /usr/lib/bluetooth/bluetoothd
Mar 03 14:17:56 mint bluetoothd[741]: Endpoint registered: sender=:1.52 path=/M>
Mar 03 14:17:56 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:56 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
Mar 03 14:17:57 mint bluetoothd[741]: Failed to add UUID: Failed (0x03)
```
Pair your bluetooth device(s) in Linux.
Reboot into Windows, and pair your same bluetooth device(s) in Windows.
Run regedt32.exe. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys"
Right-click on the "Keys" folder in the lefthand pane of the path above, and select "Export." In the pop-up dialog, change "Save as type" to "Text files," be sure that the "Export range" radio button "Selected branch" is selected, and save the file to your choice of name and location.
- Note 1. For this purpose it's convenient if you've already configured a drive partition that's shared between your two OS, but it's not absolutely necessary, as you can use a thumb drive to transfer the file as well.
- Note 2: If you have trouble exporting the folder, right click on the folder, select Permissions, and add Users to the groups that can read and edit the folder.
P.S. If you don't see keys then go on the [HKLM\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys] folder right click and click on 'Permissions' , add your windows user and give it 'Full Control' You should be able to see the pairing keys then.
Now reboot into Linux.
Open a command prompt in Linux type sudo caja (if you're not running Linux with MATE, you may have a different file manager; substitute as necessary) and enter your password at the prompt. This will open a file manager with SU rights, so handle with care ... I'm not responsible if you brick your system!
Navigate to /var/lib/bluetooth. Inside of this folder you will see one or both of two things -- either a single folder named with a single MAC address (of your computer's bluetooth adapter) or multiple folders, each with its own MAC address, for each paired bluetooth device (the MAC address will be in the format XX:XX:XX:XX:XX:XX). If you find only the single folder, folders with those individual MAC addresses will be inside the first adapter folder.
Open the folder containing the MAC address of the device you wish to pair in dual-boot mode. Inside that folder will be one or two files ... the one you care about is the "info" file. Double-click on it and it will open in a text editor with SU rights -- that is, you'll be able to edit it and save it. (by the way, if you're not sure which device you're looking for, the "info" file contains the plain-English device name, so just open each one in turn till you find the right one).
Open a separate (non-SU) instance of your file manager, and use it to open the text file you saved from Windows in another pane. When you double-click on that file, Linux may ask if you want to execute or edit it ... choose to edit.
The Windows registry export will contain multiple stanzas (one for each device) that look like this (don't worry, I've changed to a bogus MAC and key):
Value 1 Name: 0008e024d45e Type:
REG_BINARY Data: 00000000 31 c0 08 fa 4f 7b d2 4c
- 6f e1 7d ba 32 29 a9 a7 1À.ïO{ÒLoá}ºQ)©§
Find the stanza containing the value on the "Name:" line which corresponds the MAC address of the file you have open in the first (SU) pane. Note that in the Windows files, the format of the MAC address uses lower-case letters instead of upper-case, and there are no colons.
Your Bluetooth pairing key is the string in the line that begins "00000000" and ends with a bunch of gibberish. Don't copy either the zeros or the gibberish, just the string in-between containing the 16 hex codes with the dash in the middle.
Insert that key into the "Key=" line in your "info" file. You can copy and paste if you want (I did), but you need to change lower-case letters to upper-case, and delete all spaces and dashes. In the example above, the resulting line will look like this:
Key=31C008FA4F7BD24C6FE17DBA3229A9A7
- Now save the file, repeat for any additional devices. Reboot into Windows, your device should now work. Reboot into Linux, it should also work.
Good Luck
There's a quite easy solution for this problem. the problem is: Windows pairs with this bluetooth device as it's the manager of the internal bluetooth module of your laptop, however linux thinks so too.
They both have different pairing signagures.
an easy solution for this, change bluetooth mac address on linux
sudo hciconfig hci0 down
sudo bluemoon -A
sudo hciconfig hci0 up
sudo systemctl restart bluetooth.service
now you have a new identity on linux. pair with your device, note you have to do this on every restart when you return to windows you won't have to repair again.
Why does this happen?
Basically, when you pair your device, your Bluetooth service generates a unique set of pairing keys. First, your computer stores the Bluetooth device's MAC address and pairing key. Second, your Bluetooth device stores your computer's MAC address and the matching key. This usually works fine, but the MAC address for your Bluetooth port will be the same on both Linux and Windows (it is set on the hardware level). Thus, when you re-pair the device in Windows or Linux and it generates a new key, that key overwrites the previously stored key on the Bluetooth device. Windows overwrites the Linux key and vice versa.
Bluetooth LE Devices: These may pair differently. I haven't investigated myself, but this may help Dual Boot Bluetooth LE (low energy) device pairing
How to fix
Using the instructions below, we'll first pair your Bluetooth devices with Ubuntu/Linux Mint, and then we'll pair Windows. Then we'll go back into our Linux system and copy the Windows-generated pairing key(s) into our Linux system.
- Pair all devices w/ Mint/Ubuntu
- Pair all devices w/ Windows
- Copy your Windows pairing keys in one of two ways:
Use
psexec -s -i regedit.exefrom Windows (harder). You needpsexecas normal regedit doesn't have enough permissions to show this values.- Go to "Device & Printers" in Control Panel and go to your Bluetooth device's properties. Then, in the Bluetooth section, you can find the unique identifier. Copy that (you will need it later). Note: on newer versions of windows the route to the device's properties is to go through Settings -> Bluetooth & devices -> Devices -> More devices and printer settings
- Download PsExec from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx.
- Unzip the zip you downloaded and open a cmd window with elevated privileges. (Click the Start menu, search for
cmd, then right-click the CMD and click "Run as Administrator".) - cd into the folder where you unzipped your download.
- Run
psexec -s -i regedit.exe - Navigate to find the keys at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters\Keys. If there is noCurrentControlSet, tryControlSet001. - You should see a few keys labels with the MAC addresses - write down the MAC address associated with the unique identifier you copied before. Note: If there are no keys visible after pairing, you likely need to add permissions to read (right click -> permissions)
Keys\ - For convenience export it as a text file. click file -> export -> as text and save it to a shared partition/cloud.
Use
chntpwfrom your Linux distro (easier). Start in a terminal then:sudo apt-get install chntpwMount your Windows system drive in read-write mode
- To find the drive use
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL. Depending on how your dual boot is setup its usually the firstntfspartition on the drive with/boot/efi. Note theNAME. sudo mkdir /mnt/csudo mount --read-only /dev/<NAME> /mnt/c- To safely unmount the drive
sudo umount /mnt/c- If you need to try a different drive or when finished all these instructions
- To find the drive use
cd /[WindowsSystemDrive]/Windows/System32/config- on Windows 10 the root folder is "Windows", on Windows 7 it is "WINDOWS"
chntpw -e SYSTEMopens a consoleRun these commands in that console:
> # If there is no ControlSet001, then try CurrentControlSet > # on Windows 7, "services" below is lowercased. > cd ControlSet001\Services\BTHPORT\Parameters\Keys > ls # shows you your Bluetooth port's MAC address Node has 1 subkeys and 0 values key name <aa1122334455> > cd aa1122334455 # cd into the folder > ls # lists the existing devices' MAC addresses Node has 0 subkeys and 1 values size type value name [value if type DWORD] 16 REG_BINARY <001f20eb4c9a> > # Get the value of the REG_BINARY entry > hex 001f20eb4c9a => :00000 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX ...ignore..chars.. # ^ the XXs are the pairing keyMake a note of which Bluetooth device MAC address matches which pairing key. The Mint/Ubuntu one won't need the spaces in-between. Ignore the
:00000.
- Go back to Linux (if not in Linux) and add our Windows key to our Linux config entries. Just note that the Bluetooth port's MAC address is formatted differently when moving from Windows to Linux - referenced as aa1122334455 in Windows in my example above.
The Linux version will be in all caps and punctuated by ':' after every two characters - for example AA:11:22:33:44:55.
Based on your version of Linux, you can do one of these:
- Before Mint 18/16.04 you could do this:
sudo edit /var/lib/bluetooth/[MAC address of Bluetooth]/linkkeys- [the MAC address of Bluetooth] should be the only folder in that Bluetooth folder.This file should look something like this:
[Bluetooth MAC] [Pairing key] [digits in pin] [0] AA:11:22:33:44:55 XXXXXXXXxxXXxXxXXXXXXxxXXXXXxXxX 5 0 00:1D:D8:3A:33:83 XXXXXXXXxxXXxXxXXXXXXxxXXXXXxXxX 4 0Change the Linux pairing key to the Windows one, minus the spaces.
- In Mint 18 (and Ubuntu 16.04) and later you may have to do this:
Switch to root:
sudo -i(In old versions of Ubuntu, 'su -')cd to your Bluetooth config location
/var/lib/bluetooth/[bth port MAC addresses]Here you'll find folders for each device you've paired with. The folder names being the Bluetooth devices' MAC addresses and contain a single file
info. In these files, you'll see the link key you need to replace with your Windows ones, like so:[LinkKey] Key=B99999999FFFFFFFFF999999999FFFFF
- Before Mint 18/16.04 you could do this:
- Once updated, restart your Bluetooth service in one of the following ways, and then it works!
Ubuntu, Mint, Arch:
sudo systemctl restart bluetoothAlternatively, reboot your machine into Linux.
Note: do not attempt to connect before restarting Linux. A failed connection attempt may invalidate the Windows key.
- Reboot into Windows - it works!
Firstly, many answers advise replacing the key in [linkKey] section of the /var/lib/bluetooth/<ADAPTOR_MAC_ADDRESS>/<DEVICE_MAC_ADDRESS>/info file. This section now seems to be called [LongTermKey]. Also, [LocalSignatureKey] seems to now be [IdentityResolvingKey]. Some answers only mention changing the key in [linkKey], but you also need Enc,Ediv and Rand entries and the key for [IdentityResolvingKey].
Secondly, the device mac address may not be constant. In the case of my Logitech G604 it increments by one each time I pair. I updated these scripts here to resolve this.
Instructions
- Boot into Linux and pair bluetooth device(s). You'll need the newly generated
infoandattributesfiles in/var/lib/bluetooth/<ADAPTOR_MAC_ADDRESS>/<DEVICE_MAC_ADDRESS>/. - Reboot into Windows and pair bluetooth device(s).
- Download PSExec and run the following command from a Command Prompt running in Administator mode:
PsExec64.exe -s -i regedit /e C:\BTKeys.reg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys
- Copy the
C:\BTKeys.regfile to a USB key (or leave onC:drive if it's accessible from the Linux OS). - Turn off bluetooth device(s) and boot back into Linux. Don't pair the device again in Linux. It might generate a new mac address, which will break the Windows pairing. (I don't know if this is normal, but it's what happens with my Logitech G604).
- Copy the
BTKeys.regfile to your Linux filesystem. - Run
clean_reg_file.py --file_path BTKeys.reg --output clean.regto clean the file (converts encoding to UTF8 and strips quotation marks). - Run
bluetooth_fix.py --reg_path clean.reg. - From a terminal with
sudo, navigate to/var/lib/bluetooth/<ADAPTOR_MAC_ADDRESS>/. - Make a new directory corresponding to the device mac address from
BTKeys.reg. - Copy
infoandattributesfrom the old mac address directory to the new one. - Open
/var/lib/bluetooth/<ADAPTOR_MAC>/<NEW_DEVICE_MAC>/infoand modify the values as per output from step 8. - Restart bluetooth with
sudo systemctl restart bluetooth.
I have tried all types of solution.But non of them Worked so i request "What can do to make my dongule compatable with linux" or is their someother problem.I am using Ubuntu 22.04.1 LTS x86_64,Kernel: 5.15.0-47-generic.Any help is appreciate.
I’ve just started using Ubuntu and am currently dual-booting alongside Windows 11. Everything works great except for this annoying pairing issue.
Whenever I reboot into the other OS, I have to pair my headphones again, even if they were previously connected.
After switching operating systems, my previously connected device won’t connect automatically and needs to be paired again.
I have two headphones/earbuds, so at first I tried using one with each OS, but after booting into the other OS, it still didn’t work and have to remove and pair again before using it
bluetooth is turned on and when i connect to phone or wireless headest not work well although it is paired with them
for example for test i tried to send file and its size 20kb to pc and give me error message unsuccessful connection when i pair with headest it cutting off
when i use linux the problems above doesn't happen and i tried most solution but without any result and i tried to reinstall windows but no result
i face this problem after i installed Arch as dualboot next to windows espically when i tried to make bluetooth not need to repair when i boot from windows
Same symptoms as in the question happend to me on a Dell XPS 13 after installing Wacom software for a Intuos BT S tablet.
Solution for me was disabling Bluetooth in the BIOS, rebooting and enabling it in the BIOS again, as is said in this thread: https://ubuntuforums.org/showthread.php?t=2348005
Are you dual-booting windows? If you are, make sure to disable FastBoot in Windows. This is from Intel Documentation:
About dual-boot with Windows and "fast-boot" enabled If you have a dual-boot machine with a recent version of Windows and start seeing problems during initialization of the WiFi device when booting Linux, the problem could be due to the “fast startup” feature on Windows.
With this feature enabled, Windows don't really shut down the entire system, but leaves things partially running so you can start the machine faster again. Try to disable this option, on Windows 10 it should be in “Control Panel→Hardware and Sound→Power Options→System Settings”, then disable the “Fast Startup” option in “Shutdown Settings”. This will cause Windows to fully shutdown and may solve the issue.
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
Had a similar issue and figured out this was the reason.
The issue has been resolved by Intel recently !
Windows drivers where somehow interfering with the device firmware.
Just follow those instructions, from Windows :
- Download Intel latest drivers for Windows
- Disconnect your computer from Internet to prevent drivers getting installed via Windows update
- Uninstall your current driver on Windows through device manager and check "delete local driver"
- Shutdown Windows
- Boot Windows (don't forget, must have no internet access)
- You should see “Unknown device” in device manager on reboot
- Install the latest driver previously downloaded
- Boot to Linux
- Boot to Windows
- [optional, if anything wrong happen] Dump the content of
HKLM\System\Software\Intel\Bluetoothkey contents to a text file immediately after any issue occurred
Resetting the BIOS CMOS seems to be the only fix for this problem for now. This solution was described in this Arch Linux thread, which chili555 pointed me to.
Linux picked up the device again after I reset my motherboard's CMOS (by taking out the battery for a couple of minutes). I did not boot back into Windows after that.
P.S. The power failure screenshot above is unrelated, and was caused by a lose internal USB connection going into the Wifi+Bluetooth PCI-E chip.