[GH-ISSUE #1355] "Firefox is not currently set as your default browser" #933

Closed
opened 2026-05-05 07:10:49 -06:00 by gitea-mirror · 9 comments
Owner

Originally created by @BafDyce on GitHub (Jun 28, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1355

When running firefox via firejail, it displays a notice "Firefox is not currently set as your default browser. Would you like to make it your default browser?" on startup. No matter what I click on that dialog, the very same dialog apears at every launch.

This happens on two different systems:

  • Fedora with Gnome
  • Ubuntu 16.04 with Gnome

On both machines, Firefox was set as the default browser prior to installing firejail.

As a side note: The settings page says "Firefox is not your default browser", however clicking on the "Make default" button changes nothing. Is this a known limitation (I couldn't find any issue addressing this), a configuration error on my side, or a bug?

Originally created by @BafDyce on GitHub (Jun 28, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1355 When running firefox via firejail, it displays a notice "Firefox is not currently set as your default browser. Would you like to make it your default browser?" on startup. No matter what I click on that dialog, the very same dialog apears at every launch. This happens on two different systems: * Fedora with Gnome * Ubuntu 16.04 with Gnome On both machines, Firefox was set as the default browser prior to installing firejail. As a side note: The settings page says "Firefox is not your default browser", however clicking on the "Make default" button changes nothing. Is this a known limitation (I couldn't find any issue addressing this), a configuration error on my side, or a bug?
gitea-mirror 2026-05-05 07:10:49 -06:00
Author
Owner

@SkewedZeppelin commented on GitHub (Jun 28, 2017):

I can confirm this happens. It is due to two issues:

  • Firefox creates a copy of .config/mimeapps.list, then it edits it, and it moves it in place of the original.
    • This should work as it has rw of that file, but fails for some reason
  • Firefox then runs "update-mime-database"
    • This fails as .local/share/mime isn't included in the profile

As a workaround you can manually set it through Settings > Details > Default Applications in Gnome

<!-- gh-comment-id:311681209 --> @SkewedZeppelin commented on GitHub (Jun 28, 2017): I can confirm this happens. It is due to two issues: - Firefox creates a copy of .config/mimeapps.list, then it edits it, and it moves it in place of the original. - This should work as it has rw of that file, but fails for some reason - Firefox then runs "update-mime-database" - This fails as .local/share/mime isn't included in the profile As a workaround you can manually set it through Settings > Details > Default Applications in Gnome
Author
Owner

@netblue30 commented on GitHub (Jun 28, 2017):

If we just whitelist ~/.local/share/mime and ~/config/mimeapps.list, would it fix it?

<!-- gh-comment-id:311709144 --> @netblue30 commented on GitHub (Jun 28, 2017): If we just whitelist ~/.local/share/mime and ~/config/mimeapps.list, would it fix it?
Author
Owner

@BafDyce commented on GitHub (Jun 28, 2017):

  • Firefox creates a copy of .config/mimeapps.list, then it edits it, and it moves it in place of the original.
    • This should work as it has rw of that file, but fails for some reason

Looking at firefox.profile, I cannot find a whitelist entry for that file

  • Firefox then runs "update-mime-database"
    • This fails as .local/share/mime isn't included in the profile

Would it be acceptable to include it into the profile?

As a workaround you can manually set it through Settings > Details > Default Applications in Gnome

Firefox is set as the default browser there :/

<!-- gh-comment-id:311709497 --> @BafDyce commented on GitHub (Jun 28, 2017): > * Firefox creates a copy of .config/mimeapps.list, then it edits it, and it moves it in place of the original. > * This should work as it has rw of that file, but fails for some reason Looking at firefox.profile, I cannot find a whitelist entry for that file > * Firefox then runs "update-mime-database" > * This fails as .local/share/mime isn't included in the profile Would it be acceptable to include it into the profile? > As a workaround you can manually set it through Settings > Details > Default Applications in Gnome Firefox is set as the default browser there :/
Author
Owner

@BafDyce commented on GitHub (Jun 28, 2017):

@netblue30
I can test it, if you want.

<!-- gh-comment-id:311709653 --> @BafDyce commented on GitHub (Jun 28, 2017): @netblue30 I can test it, if you want.
Author
Owner

@netblue30 commented on GitHub (Jun 28, 2017):

Thanks, give it a try.

<!-- gh-comment-id:311709844 --> @netblue30 commented on GitHub (Jun 28, 2017): Thanks, give it a try.
Author
Owner

@BafDyce commented on GitHub (Jun 28, 2017):

I added the following rules to my profile:

<block of noblacklist lines>
noblacklist ~/.config/mimeapps.list
noblacklist ~/.local/share/mime

...

<block of whitelist lines>
whitelist ~/.config/mimeapps.list
whitelist ~/.local/share/mime

However, I still get errors when trying to set firefox as the default browser (via the button in the preferences tab):

** (firefox:5): WARNING **: Cannot set application as default for URI scheme (http): Failed to rename file '/home/user/.config/mimeapps.list.EKLK2Y' to '/home/user/.config/mimeapps.list': g_rename() failed: Device or resource busy

lsof (run from the host, outside the jail) doesn't report the file as opened by another application.

Any idea why it still doesn't work?

<!-- gh-comment-id:311717463 --> @BafDyce commented on GitHub (Jun 28, 2017): I added the following rules to my profile: ``` <block of noblacklist lines> noblacklist ~/.config/mimeapps.list noblacklist ~/.local/share/mime ... <block of whitelist lines> whitelist ~/.config/mimeapps.list whitelist ~/.local/share/mime ``` However, I still get errors when trying to set firefox as the default browser (via the button in the preferences tab): ``` ** (firefox:5): WARNING **: Cannot set application as default for URI scheme (http): Failed to rename file '/home/user/.config/mimeapps.list.EKLK2Y' to '/home/user/.config/mimeapps.list': g_rename() failed: Device or resource busy ``` lsof (run from the host, outside the jail) doesn't report the file as opened by another application. Any idea why it still doesn't work?
Author
Owner

@SkewedZeppelin commented on GitHub (Jun 28, 2017):

.config/mimeapps.list is already whitelisted through whitelist-common.inc and like I said its weird, it should be able to edit .config/mimeapps.list

You can do manual testing using "firejail --profile=/etc/firejail/firejail.profile /bin/bash"

Edit: As a workaround you can simply disable the check in Preferences > General > "Always check if Firefox is your default browser"

<!-- gh-comment-id:311720001 --> @SkewedZeppelin commented on GitHub (Jun 28, 2017): .config/mimeapps.list is already whitelisted through whitelist-common.inc and like I said its weird, it should be able to edit .config/mimeapps.list You can do manual testing using "firejail --profile=/etc/firejail/firejail.profile /bin/bash" Edit: As a workaround you can simply disable the check in Preferences > General > "Always check if Firefox is your default browser"
Author
Owner

@smitsohu commented on GitHub (Sep 13, 2017):

~/.config/mimeapps.list is a mount point (it is explicitly whitelisted), and the issue is that we cannot run rename() on a mount point. It produces the Device or resource busy error mentioned above.
If instead the whole ~/.config is whitelisted, everything works again as expected.

I observe the same with KDE apps that make use of KConfig, probably because the mechanism is similar... also there making configuration files mount points (e.g. by whitelisting, noexec, ...) effectively freezes the settings.

As an example a little experiment with Kate, $HOME needs an exec flag:
Run firejail --noexec=~/.config/katerc kate and change some settings. It can't safe it, everything is restored at next startup. But if the noexec option is left away, it works without a flaw.

Then, try it outside firejail, for example sudo mount --bind $HOME/.config/katerc $HOME/.config/katerc. The outcome is the same: No settings are saved, until the file is unmounted again.

Executing a tiny program that does nothing but calling rename() or simply running mv $HOME/.config/katerc $HOME/.config/katerc_new returns Device or resource busy, both inside and outside firejail.

<!-- gh-comment-id:329206354 --> @smitsohu commented on GitHub (Sep 13, 2017): ~/.config/mimeapps.list is a mount point (it is explicitly whitelisted), and the issue is that we cannot run rename() on a mount point. It produces the `Device or resource busy` error mentioned above. If instead the whole ~/.config is whitelisted, everything works again as expected. I observe the same with KDE apps that make use of KConfig, probably because the mechanism is similar... also there making configuration files mount points (e.g. by whitelisting, noexec, ...) effectively freezes the settings. As an example a little experiment with Kate, $HOME needs an exec flag: Run `firejail --noexec=~/.config/katerc kate` and change some settings. It can't safe it, everything is restored at next startup. But if the noexec option is left away, it works without a flaw. Then, try it outside firejail, for example `sudo mount --bind $HOME/.config/katerc $HOME/.config/katerc`. The outcome is the same: No settings are saved, until the file is unmounted again. Executing a tiny program that does nothing but calling rename() or simply running `mv $HOME/.config/katerc $HOME/.config/katerc_new` returns `Device or resource busy`, both inside and outside firejail.
Author
Owner

@chiraag-nataraj commented on GitHub (Jul 22, 2018):

I think there are enough workarounds in the thread that we can close the issue.

<!-- gh-comment-id:406891930 --> @chiraag-nataraj commented on GitHub (Jul 22, 2018): I think there are enough workarounds in the thread that we can close the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#933
No description provided.