keepassxc-browser
keepassxc-browser copied to clipboard
Browser Integration not operable on Firefox Ubuntu 21.10 (Snap)
When trying to connect to the KeePassXC browser plugin to the database's browser integration, it should connect, however, it errors out with "Key Exchange failed." I believe the reason for this bug is Mozilla's request to move to Snap as the default starting with Ubuntu 21.10.
Debug info
KeePassXC - 2.6.6 Revision 9c108b9 KeePassXC-Browser - 1.7.9.1 Operating system: Ubuntu 21.10 amd64 Browser: Firefox 93.0
You might be tempted to close this saying "We don't support snap installed browsers," however, it is not out of the question for Canonical and Mozilla to remove Firefox completely from the apt repositories in 22.04 or some later versions, and a workaround will be needed for this eventuality.
Yup the workaround is Auto-Type. Every native messaging based plugin will be broken. This includes one's that talk to smart cards. Until the browser snap itself supports native messaging this is dead in the water.
This discussion is very relevant: https://bugzilla.mozilla.org/show_bug.cgi?id=1621763
Yup the workaround is Auto-Type. Every native messaging based plugin will be broken. This includes one's that talk to smart cards. Until the browser snap itself supports native messaging this is dead in the water.
I would so LOVE to have back auto-type. But that does not work on wayland (as far as I am aware?) so right now, on ubuntu 21.10, no option remains.
I moved firefox back to debian packages, but even there I can't connect KeePassXC right now (which used to work before the upgrade).
I moved firefox back to debian packages, but even there I can't connect KeePassXC right now (which used to work before the upgrade).
i am not using the firefox-extention, but experienced similar with autotype - installed firefox deb-package in ubuntu 21.10, but keepassxc does not recognize any firefox-window. Autotype is not working and trying to add a window manual under auto-type does not list any open firefox-page. I tried same thing last night with Chrome and had no issue there with auto-type...
That may be because Firefox is running under wayland.
For firefox, the lack of NativeMessaging support in the snap is being tracked by bugzilla bug #1661935, and there's a proposal for an XDG desktop portal to solve the case for both snaps and flatpaks.
Is there any available work-around for now?
Thanks!
@bouncinglime Use a browser that is not installed via Snap or Flatpak.
@varjolintu I take it that means there is no workaround for using KeePassXC-browser with Firefox 93+ on Ubuntu 21.04+?
@varjolintu I take it that means there is no workaround for using KeePassXC-browser with Firefox 93+ on Ubuntu 21.04+?
Just remove Snap Firefox (I believe it's snap remove firefox --purge) and then install Firefox from apt (sudo apt-get install firefox) and it will work fine
@bouncinglime Use a browser that is not installed via Snap or Flatpak.
This is next to impossible. I tried that, but my ubuntu keeps converting my firefox over to snap.
@bouncinglime Use a browser that is not installed via Snap or Flatpak.
This is next to impossible. I tried that, but my ubuntu keeps converting my firefox over to snap.
@ccoenen, I'm on Ubuntu 21.10. I removed snap and installed Firefox via apt. Currently installed Firefox is 95.0.1+build2-0ubuntu0.21.10.1
@bouncinglime Use a browser that is not installed via Snap or Flatpak.
I do not have snap installed on my computer at all, so my Firefox has been installed via apt. KeePassXC-browser is still not working.
@bouncinglime And you have checked the Native Messaging script locations and everything from Troubleshooting Guide?
as a workaround I decided to download Firefox and run the binary from the folder https://www.mozilla.org/en-US/exp/firefox/new/
migrating my profile was also easy https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile
Some people report on Reddit that Ubuntu has reinstalled the Snap version of Firefox on update. Make sure you are not running a Snap version.
yup, this also happened on my machine, so I gave up: https://github.com/keepassxreboot/keepassxc-browser/issues/1426#issuecomment-1005090609
If you need a work around for the meanwhile and you don't mind using the beta release of Firefox you can use the official Firefox Next PPA. The packages from this PPA still package Firefox as usual.
Since I upgraded my Ubuntu system from 21.10 to 22.04 which converted my existing Firefox install to snap, these are the steps I used:
- Add the PPA:
sudo add-apt-repository ppa:mozillateam/firefox-next
sudo apt-get update
- Verify you see the PPA beta release of Firefox available:
apt info firefox -a
- Remove the existing packages/snap:
sudo apt -y --purge remove firefox*
sudo snap remove firefox
- Pin the Firefox package to the PPA beta releases:
cat << EOF | sudo tee /etc/apt/preferences.d/firefox
Package: firefox*
Pin: origin ppa.launchpadcontent.net
Pin-Priority: 600
EOF
- Install the Firefox package and relevant locale (if required):
sudo apt -y install firefox firefox-locale-en
I didn't lose any data doing this but your mileage may vary so be careful (eg. take a backup of your Firefox profile).
Here is another description how to remove snap and install Firefox via deb for Ubuntu 22.04 Jammy: https://fostips.com/ubuntu-21-10-two-firefox-remove-snap/ It works for me.
@bouncinglime And you have checked the Native Messaging script locations and everything from Troubleshooting Guide?
I had no idea this troubleshooting guide was available. I would definitely recommend that everyone having this issue check it out.
However! It did not solve my problem. Everything was correct per the guide.
Turns out I had apparmor running on Firefox. Check your own system by running sudo aa-status (more details here) and disable the profile for firefox if it's there. I'm using apparmor and firejail to keep Zoom isolated, so I didn't want to disable it entirely.
Both keepass and gnome extensions are now working in my firefox.
Need to add apparmor and firejail on the browser and/or keepassxc to the troubleshooting guide
Right now the information about Firefox installed as SNAP not working is scattered around github issues. Maybe it would be good to include a question in the FAQ (https://keepassxc.org/docs/#faq-browser) about this SNAP problem.
Also, by reading this issue, I got the impression that we can use KeepassXC Auto-type with Firefox installed as SNAP. Is that correct? Is there a tutorial for that?
Read the keepassxc user guide
Read the keepassxc user guide
Thanks, just found the info on Auto-type. I was looking at the Getting Started guide. Still, I believe it would be usefull to add an entry in the FAQ, mentioning the SNAP issue and that Auto-type should work
It would also be great if there was a link to the Troubleshooting Guide from the FAQ as well as on the main GitHub page for this project.
I had the same trouble. Fixed by excluding Firefox from apparmor profiles (or you can disable it at all, but I don't recommend to do this). Just move /etc/apparmor.d/usr.bin.filefox into /etc/apparmor.d/disabled and reboot.
I think, it is possible to just add some rules into the profile to enable keepassxc-proxy to be executed, but I don't know how...
According to Ubuntu, the Firefox Beta Snap packages should already work with KeePassXC-Browser. Haven't tested it myself yet though. https://www.omgubuntu.co.uk/2022/07/ubuntu-devs-fix-another-frustrating-firefox-snap-flaw
EDIT: Tested it with the latest Kubuntu, and it worked nicely.
@varjolintu any additional steps were necessary? My Firefox (Snap, version 105.0.1) have never displayed that "allow to start WebExtension" prompt from omgubuntu link you've posted and KeePass plugin still doesn't connect to KeePass.
@varjolintu any additional steps were necessary? My Firefox (Snap, version 105.0.1) have never displayed that "allow to start WebExtension" prompt from omgubuntu link you've posted and KeePass plugin still doesn't connect to KeePass.
Using the beta? I have no idea if the feature is in stable Firefox Snap.