mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6681] element-desktop: program does not start (apparmor + electron) #3334
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#3334
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leukimi on GitHub (Mar 13, 2025).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6681
Description
firejail element-desktop does not start on Xubuntu 24.04.
Steps to Reproduce
Steps to reproduce the behavior
LC_ALL=C firejail /usr/bin/element-desktop(orLC_ALL=C firejail /opt/Element/element-desktop)/opt/Element/chrome-sandbox ... owned by root ... mode 4755Expected behavior
element-desktop window opens and app functions as normal
Actual behavior
app crasch:
aborting...Behavior without a profile
Calling
LC_ALL=C firejail --noprofile /usr/bin/element-desktop(orLC_ALL=C firejail --noprofile /opt/Element/element-desktop) in a terminal makes app work as expected.Environment
Checklist
Log
Output of
LC_ALL=C firejail /usr/bin/element-desktopOutput of
LC_ALL=C firejail --debug /usr/bin/element-desktopdebug.log
@kmk3 commented on GitHub (Mar 14, 2025):
Looks similar to:
What is the output of the following?
Does it work with the following?
@leukimi commented on GitHub (Mar 14, 2025):
Same issue detected also in Ubuntu Budgie 24.04.
$ firejail element-desktop --no-sandboxseems to open the element-desktop window.@kmk3 commented on GitHub (Mar 14, 2025):
Interesting.
For reference, this issue seems to affect other electron-based programs:
And there is a similar issue that affects webkit-based programs:
Note that there was an electron refactoring done in the current development
version.
Is there any change with firejail-git?
@rusty-snake commented on GitHub (Mar 14, 2025):
Duplicate of #6368
@rusty-snake commented on GitHub (Mar 14, 2025):
Also see #6675
@kmk3 commented on GitHub (Mar 14, 2025):
Can you clarify?
This seems to have been happening before AppArmor 4.x (such as with #4422) and
the error messages seem to be different.
@leukimi
Does anything change when running with
--ignore=apparmor? Example:Are there recent
auditmessages when runningsudo dmesg?What is the output of the following?
@leukimi commented on GitHub (Mar 14, 2025):
LC_ALL=C firejail --ignore=apparmor /usr/bin/element-desktopopens the element-desktop window.@kmk3 commented on GitHub (Mar 14, 2025):
Thanks for the details.
To clarify, does the program just work normally with
--ignore=apparmor?If not, what is in the program output?
@rusty-snake
Thoughts on disabling apparmor on browser/electron profiles?
Or does the apparmor issue affect all profiles?
@leukimi commented on GitHub (Mar 14, 2025):
The program seems work normally with
--ignore=apparmor.The program seems also to work normally with
--no-sandbox.It is a bit hard for me at this point to know if
element-desktopworks as "it should". For instance a user got automatically logged out when a computer rebooted. After re-install ofelement desktop, that logout behavior seems to be gone. At times it can be impossible to log in and one has to try many times. If these things are connected to firejail or only "bugs" and "glitches" is very hard to say. I have managed to get the basic things working like create a matrix:room, send a matrix:message and making a matrix:call both with firejail and without firejail.@rusty-snake commented on GitHub (Mar 14, 2025):
All that
apparmorrestrict-namespaces(i.e. unshare a new user namespace)@leukimi can you try if
--ignore=apparmor --apparmor-replaceworks.Disabling apparmor, kicking out of firecfg, ... no real opinion and actually I don't care much.
DON'T (except for testing)
@leukimi commented on GitHub (Mar 14, 2025):
LC_ALL=C firejail --ignore=apparmor --apparmor-replace /usr/bin/element-desktopworks and appelement-desktopopens and revives previous verified session.@Nao-30 commented on GitHub (May 9, 2025):
Ubuntu 23.XX and higher versions implemented a stricter security model through AppArmor that specifically targets unprivileged user namespaces2.
you can review the full article
For a complete understanding of this issue, including technical details, implementation specifics, you can take a look at:
Technical Deep Dive
For a more direct practical solutions and safest options, you can take a look at:
Practical Workarounds
Basically yhe issue happens because AppImages are FUSE-mounted with
nosuid, this prevents any set-UID helper from running~Ubuntu’s default AppArmor policy also disallows unprivileged user namespaces
so now as mentioned the AppImage can use neither the kernel userns nor the setuid sandbox. In short, on Ubuntu 23.++ an electron AppImage is trapped: it's
chrome-sandboxcan’t be made set-UID on the FUSE mount, and userns is blocked (unless you add a custom AppArmor profile to allow it as mentioned in the blog based on askubuntu.com).By contrast, the
.tar.gzrelease is simply unpacked onto a normal filesystem (e.g./opt/void). This means itschrome-sandboxbinary is on an ordinary ext4 (or similar) partition, not under a FUSEnosuidmount. A packager or user can then run:– granting it the correct owner and set-UID bit. Once the helper is root-owned, and correct permissions are set the Chromium sandbox should run as intended. Because the tar.gz's files aren’t subject to AppImage/AppArmor quirks and stuff, the sandbox must work normally after this fix
and ofc (No special AppArmor profile is needed for the tar install, unlike the AppImage case)