[GH-ISSUE #4282] chromium: Unable to open X display (missing whitelist) #2605

Closed
opened 2026-05-05 09:16:30 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @Xwang1976 on GitHub (May 15, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4282

Bug and expected behavior
When I run firejail chromium

I get the following messages:

Reading profile /etc/firejail/chromium.profile
Reading profile /etc/firejail/chromium-common.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-runuser-common.inc
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Warning: Warning: NVIDIA card detected, nogroups command disabled
Parent pid 9083, child pid 9084
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: Cannot confine the application using AppArmor.
Maybe firejail-default AppArmor profile is not loaded into the kernel.
As root, run "aa-enforce firejail-default" to load it.
Child process initialized in 185.45 ms
No protocol specified
[6:6:0516/013812.224391:ERROR:browser_main_loop.cc(1386)] Unable to open X display.

Parent is shutting down, bye...

No profile and disabling firejail
Nothing changes calling firejail /usr/bin/chromium.

Calling firejail --noprofile /usr/bin/chromium opens the program correctly.

I've noted that executing xhost + before running firejail chromium solves the issue, but I'm not sure if it is safe to do.

Environment
I'm running archlinux, with rootless xorg using sddm-git and kde.
firejail version 0.9.64.4

Additional context
The same issue happens with other programs too.
It seems as the only way to have it working correctly is by setting xhost +

Edit: Formatting.

Originally created by @Xwang1976 on GitHub (May 15, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4282 **Bug and expected behavior** When I run `firejail chromium` I get the following messages: ``` Reading profile /etc/firejail/chromium.profile Reading profile /etc/firejail/chromium-common.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-exec.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/disable-xdg.inc Reading profile /etc/firejail/whitelist-common.inc Reading profile /etc/firejail/whitelist-runuser-common.inc Reading profile /etc/firejail/whitelist-usr-share-common.inc Reading profile /etc/firejail/whitelist-var-common.inc Warning: Warning: NVIDIA card detected, nogroups command disabled Parent pid 9083, child pid 9084 Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set. Warning: /sbin directory link was not blacklisted Warning: /usr/sbin directory link was not blacklisted Warning: Cannot confine the application using AppArmor. Maybe firejail-default AppArmor profile is not loaded into the kernel. As root, run "aa-enforce firejail-default" to load it. Child process initialized in 185.45 ms No protocol specified [6:6:0516/013812.224391:ERROR:browser_main_loop.cc(1386)] Unable to open X display. Parent is shutting down, bye... ``` **No profile and disabling firejail** Nothing changes calling `firejail /usr/bin/chromium`. Calling `firejail --noprofile /usr/bin/chromium` opens the program correctly. I've noted that executing `xhost +` before running `firejail chromium` solves the issue, but I'm not sure if it is safe to do. **Environment** I'm running archlinux, with rootless xorg using sddm-git and kde. firejail version 0.9.64.4 **Additional context** The same issue happens with other programs too. It seems as the only way to have it working correctly is by setting `xhost +` Edit: Formatting.
Author
Owner

@Xwang1976 commented on GitHub (May 16, 2021):

Running xhost SI:localuser:myusername solves the issue too and maybe it is safer tha xhost +
The fact is that till yesterday everything was working correctly.
I've "only" removed GDM and installed SDDM.
With GDM Xorg was alredy runned rootlessy

<!-- gh-comment-id:841743122 --> @Xwang1976 commented on GitHub (May 16, 2021): Running xhost SI:localuser:myusername solves the issue too and maybe it is safer tha xhost + The fact is that till yesterday everything was working correctly. I've "only" removed GDM and installed SDDM. With GDM Xorg was alredy runned rootlessy
Author
Owner

@rusty-snake commented on GitHub (May 16, 2021):

Where is your Xauthority file (echo $XAUTHORITY)?

<!-- gh-comment-id:841777221 --> @rusty-snake commented on GitHub (May 16, 2021): Where is your Xauthority file (`echo $XAUTHORITY`)?
Author
Owner

@Xwang1976 commented on GitHub (May 16, 2021):

When using sddm, echo $XAUTHORITY gives /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 with the file name changingat every reboot
Using GDM echo $XAUTHORITY gives /run/user/1000/gdm/Xauthority

Moreover when I look at the Xorg process it is runned by sddm as:
/usr/lib/Xorg -nolisten tcp -background none -seat seat0 -noreset -keeptty -novtswitch -verbose 3 -auth /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 -displayfd 8 vt1 -logfile /dev/null

GDM instead runs Xorg in this way:
/usr/lib/Xorg vt2 -displayfd 3 -auth run run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3

Finally running xauth when started by sddm I get:
access control enabled, only authorized clients can connect

Whereas running when uning GDM I get:
access control enabled, only authorized clients can connect
SI:localuser:andreak

<!-- gh-comment-id:841802612 --> @Xwang1976 commented on GitHub (May 16, 2021): When using sddm, echo $XAUTHORITY gives /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 with the file name changingat every reboot Using GDM echo $XAUTHORITY gives /run/user/1000/gdm/Xauthority Moreover when I look at the Xorg process it is runned by sddm as: /usr/lib/Xorg -nolisten tcp -background none -seat seat0 -noreset -keeptty -novtswitch -verbose 3 -auth /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 -displayfd 8 vt1 -logfile /dev/null GDM instead runs Xorg in this way: /usr/lib/Xorg vt2 -displayfd 3 -auth run run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3 Finally running xauth when started by sddm I get: access control enabled, only authorized clients can connect Whereas running when uning GDM I get: access control enabled, only authorized clients can connect SI:localuser:andreak
Author
Owner

@rusty-snake commented on GitHub (May 16, 2021):

Can you try to add this line to /etc/firejail/whitelist-runuser-common.inc

whitelist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]
<!-- gh-comment-id:841839316 --> @rusty-snake commented on GitHub (May 16, 2021): Can you try to add this line to `/etc/firejail/whitelist-runuser-common.inc` ``` whitelist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]] ```
Author
Owner

@Xwang1976 commented on GitHub (May 16, 2021):

Adding that line solves the issue.

<!-- gh-comment-id:841840646 --> @Xwang1976 commented on GitHub (May 16, 2021): Adding that line solves 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#2605
No description provided.