[GH-ISSUE #1631] Qt5 do not inherit GTK theme when in a GTK environment [0.9.50] #1097

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

Originally created by @ghost on GitHub (Nov 4, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1631

When using QT_QPA_PLATFORMTHEME=gtk2 environment variable with qt5-styleplugins and loading, for instance, keepassxc (2.2.2 — Qt 5.9.2) with firejail --noprofile the GTK theme is loaded.

Running keepassxc with the default firejail profile loads the default Qt5 theme instead and I get:
(not sure which line might be relevant)

Reading profile /etc/firejail/keepassxc.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Warning: noroot option is not available
Parent pid 27314, child pid 27315
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Child process initialized in 127.45 ms

(keepassxc:7): IBUS-WARNING **: Unable to load /var/lib/dbus/machine-id: Failed to open file “/var/lib/dbus/machine-id”: No such file or directory
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: nouveau
Originally created by @ghost on GitHub (Nov 4, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1631 When using `QT_QPA_PLATFORMTHEME=gtk2` environment variable with `qt5-styleplugins` and loading, for instance, keepassxc (2.2.2 — Qt 5.9.2) with `firejail --noprofile` the GTK theme is loaded. Running keepassxc with the default firejail profile loads the default Qt5 theme instead and I get: (not sure which line might be relevant) ``` Reading profile /etc/firejail/keepassxc.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-passwdmgr.inc Reading profile /etc/firejail/disable-programs.inc Warning: noroot option is not available Parent pid 27314, child pid 27315 Warning: /sbin directory link was not blacklisted Warning: /usr/sbin directory link was not blacklisted Child process initialized in 127.45 ms (keepassxc:7): IBUS-WARNING **: Unable to load /var/lib/dbus/machine-id: Failed to open file “/var/lib/dbus/machine-id”: No such file or directory libGL error: failed to open drm device: No such file or directory libGL error: failed to load driver: nouveau ```
gitea-mirror 2026-05-05 07:26:57 -06:00
Author
Owner

@netblue30 commented on GitHub (Nov 6, 2017):

I don't think plugins ever worked, I'll look into it.

<!-- gh-comment-id:342149406 --> @netblue30 commented on GitHub (Nov 6, 2017): I don't think plugins ever worked, I'll look into it.
Author
Owner

@viking777 commented on GitHub (Mar 2, 2018):

I have an almost identical error with keepassxc and firejail:

keepassxc:8): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-U61CB5DNR9: Connection refused
Qt: Session management error: Could not open network socket
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: i965

This has occurred since the update from 2.2.4-1 -> 2.3.0-1. The earlier version had no problem with firejail. Using the --noprofile switch allows keepassxc to open normally otherwise it just hangs forever.

Edit: Unlike the OP I am not using any plugins.

<!-- gh-comment-id:369924860 --> @viking777 commented on GitHub (Mar 2, 2018): I have an almost identical error with keepassxc and firejail: > keepassxc:8): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-U61CB5DNR9: Connection refused > Qt: Session management error: Could not open network socket > libGL error: MESA-LOADER: failed to retrieve device information > libGL error: Version 4 or later of flush extension not found > libGL error: failed to load driver: i915 > libGL error: failed to open drm device: No such file or directory > libGL error: failed to load driver: i965 This has occurred since the update from 2.2.4-1 -> 2.3.0-1. The earlier version had no problem with firejail. Using the --noprofile switch allows keepassxc to open normally otherwise it just hangs forever. Edit: Unlike the OP I am not using any plugins.
Author
Owner

@Vincent43 commented on GitHub (Mar 2, 2018):

@viking777 can you try this? https://github.com/netblue30/firejail/issues/1791#issuecomment-369741730

<!-- gh-comment-id:369958420 --> @Vincent43 commented on GitHub (Mar 2, 2018): @viking777 can you try this? https://github.com/netblue30/firejail/issues/1791#issuecomment-369741730
Author
Owner

@viking777 commented on GitHub (Mar 2, 2018):

@Vincent43 I already did try it - no difference.

One thing that may be significant to this is that /tmp/dbus-U61CB5DNR9 which keepassxc is complaining about doesn't exist in the distros /tmp directory (there are no dbus folders at all in there), so unless it is referring to the private-tmp directory in the chroot then it is never going to be able to connect to a dbus socket in /tmp.

Incidentally, I am using Manjaro linux with Xfce4 desktop, but I have a bit of a mongrel system, with applications from Gnome and Kde as well as Xfce so consequently I have gtk2, gtk3, qt4 and qt5 all installed at the same time - but that didn't worry the last version of keepassxc one bit.

<!-- gh-comment-id:369968375 --> @viking777 commented on GitHub (Mar 2, 2018): @Vincent43 I already did try it - no difference. One thing that may be significant to this is that /tmp/dbus-U61CB5DNR9 which keepassxc is complaining about doesn't exist in the distros /tmp directory (there are no dbus folders at all in there), so unless it is referring to the private-tmp directory in the chroot then it is never going to be able to connect to a dbus socket in /tmp. Incidentally, I am using Manjaro linux with Xfce4 desktop, but I have a bit of a mongrel system, with applications from Gnome and Kde as well as Xfce so consequently I have gtk2, gtk3, qt4 and qt5 all installed at the same time - but that didn't worry the last version of keepassxc one bit.
Author
Owner

@Vincent43 commented on GitHub (Mar 2, 2018):

Try to add ignore private-tmp in same file.

<!-- gh-comment-id:369993018 --> @Vincent43 commented on GitHub (Mar 2, 2018): Try to add `ignore private-tmp` in same file.
Author
Owner

@viking777 commented on GitHub (Mar 2, 2018):

@Vincent43 I had already tried commenting out 'private-tmp' which made no difference, changing that to 'ignore private-tmp' was equally ineffective.
Thanks for the suggestions though.

<!-- gh-comment-id:370013032 --> @viking777 commented on GitHub (Mar 2, 2018): @Vincent43 I had already tried commenting out 'private-tmp' which made no difference, changing that to 'ignore private-tmp' was equally ineffective. Thanks for the suggestions though.
Author
Owner

@Fred-Barclay commented on GitHub (Mar 3, 2018):

@viking777 Is there a line like export QT_STYLE_OVERRIDE=gtk in your .bashrc?

Firejail sometimes uses a different .bashrc inside the sandbox than your real one (I don't recall the exact circumstances when this happens just now), so perhaps that's what's going on and QT_STYLE_OVERRIDE=gtk isn't being set inside the sandbox.

<!-- gh-comment-id:370115288 --> @Fred-Barclay commented on GitHub (Mar 3, 2018): @viking777 Is there a line like `export QT_STYLE_OVERRIDE=gtk` in your .bashrc? Firejail sometimes uses a different .bashrc inside the sandbox than your real one (I don't recall the exact circumstances when this happens just now), so perhaps that's what's going on and QT_STYLE_OVERRIDE=gtk isn't being set inside the sandbox.
Author
Owner

@viking777 commented on GitHub (Mar 3, 2018):

Thanks for the reply Fred. My .bashrc did not contain that line, so I added it, rebooted and tried again, but no joy, still the same error as above.

I also tried the suggestion in issue 1791 by SkewedZeppelin -

should be fixed by commenting net none and blacklist /run/user/*/bus

that didn't work either.

As I mentioned above, it works with the --noprofile switch, so it must be something in the /etc/firejail/keepassxc.profile that is causing it, but I don't know what.

<!-- gh-comment-id:370139343 --> @viking777 commented on GitHub (Mar 3, 2018): Thanks for the reply Fred. My .bashrc did not contain that line, so I added it, rebooted and tried again, but no joy, still the same error as above. I also tried the suggestion in issue 1791 by SkewedZeppelin - > should be fixed by commenting net none and blacklist /run/user/*/bus that didn't work either. As I mentioned above, it works with the --noprofile switch, so it must be something in the /etc/firejail/keepassxc.profile that is causing it, but I don't know what.
Author
Owner

@viking777 commented on GitHub (Mar 3, 2018):

I finally got an answer to this.
I went through the profile line by line commenting out each one in turn and then attempting to start the program - a very long job! I started at the top and the line that is causing the problem third from the bottom!

Anyway the answer is that in order for it to work you have to comment out the line reading

memory-deny-write-execute

I don't know the full consequences of that but it is probably safer than running it with the --noprofile option.

Edit: Incidentally, the original error message I reported is still showing even though the program now works, so it is probably completely spurious as with so many others in the world of computing.

<!-- gh-comment-id:370145374 --> @viking777 commented on GitHub (Mar 3, 2018): I finally got an answer to this. I went through the profile line by line commenting out each one in turn and then attempting to start the program - a very long job! I started at the top and the line that is causing the problem third from the bottom! Anyway the answer is that in order for it to work you have to comment out the line reading `memory-deny-write-execute` I don't know the full consequences of that but it is probably safer than running it with the --noprofile option. Edit: Incidentally, the original error message I reported is still showing even though the program now works, so it is probably completely spurious as with so many others in the world of computing.
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#1097
No description provided.