I’ve set up a separate user account on my system for work-related stuff. I usually use my employer’s hardware, but we’re allowed to use our own device and sometimes it’s simply convenient to work on my linux instead of a Mac.
This has led me to a problem that I haven’t encountered before: bluetooth seems straight-up wonky when I switch between users. I have bluetooth headphones, for example, that have always worked fine. Noticing that they didn’t receive any sound when I switched to the work account was the first hiccup.
No problem, I thought, I’ll re-pair every time I switch from the one account to the other. No such luck. Pairing works, but it’s associated with the previous account. Not even “forgetting” the device helped.
No problem, I thought. I’ve got an extra bluetooth headset. I’ll pair the one while I’m in the one account and the other while I’m in the other account. No such luck. I get stuck in a “connected”, “disconnected” loop.
I had hoped that this was an audio issue and used arch’s pulseaudio documentation to make audio sharable between accounts, which worked for a wired connect, but it’s at that point that I realized, this doesn’t work for bluetooth devices, because of the issues described above.
Has anyone managed to get this working? I’m open to workarounds, as long as they work consistently and allow me to switch back and forth between accounts.
I’ve got a solution for a situation that is temptingly similar, but unfortunately probably not helpful for your specific case since I’m using partitions instead of user accounts. I have a separate partition for work (specifically a second SSD) because my employer insisted I install remote access software, and that’s not going on my personal partition. I ran into a problem where my Bluetooth MAC is the same on both partitions (because it’s the same device), but only one partition has the pairing keys for my headphones. On the other partition the headphones see the computer as an already-paired device, so refuse to pair again, but can’t connect either due to lack of a key.
I fixed the problem by copying the pairing state files from one partition to the other, and now my devices connect seamlessly either way. I think those files are in
/var/lib/bluetooth/<BT-Adapter-MAC-address>
, but my memory isn’t super clear.