[GH-ISSUE #514] Error: cannot open display: :0 #364

Closed
opened 2026-05-05 05:41:59 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @ghost on GitHub (May 13, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/514

I recently installed plasma5 with kubuntu 16.04
I wasn't happy with it, so went back to linux mint 17.3
I kept my original home in the process, my home is very old....

now, firefox doesn't launch inside firejail. It complaining about not been able to connect to the display....

Error: cannot open display: :0

This in my normal home, if i start a new user, it works fine. The firefox user profile isn't the problem either. Normal firefox seams fine.

If i remove these lines

whitelist ${DOWNLOADS}
whitelist ~/.mozilla
whitelist ~/.cache/mozilla/firefox
whitelist ~/dwhelper
include /etc/firejail/whitelist-common.inc

It works, they are all folders that actually exist, and presume the include has some whitelisted folders that exist.

downgrading to Firefox 28 didn't help...

Originally created by @ghost on GitHub (May 13, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/514 I recently installed plasma5 with kubuntu 16.04 I wasn't happy with it, so went back to linux mint 17.3 I kept my original home in the process, my home is very old.... now, firefox doesn't launch inside firejail. It complaining about not been able to connect to the display.... Error: cannot open display: :0 This in my normal home, if i start a new user, it works fine. The firefox user profile isn't the problem either. Normal firefox seams fine. If i remove these lines whitelist ${DOWNLOADS} whitelist ~/.mozilla whitelist ~/.cache/mozilla/firefox whitelist ~/dwhelper include /etc/firejail/whitelist-common.inc It works, they are all folders that actually exist, and presume the include has some whitelisted folders that exist. downgrading to Firefox 28 didn't help...
gitea-mirror 2026-05-05 05:41:59 -06:00
Author
Owner

@netblue30 commented on GitHub (May 14, 2016):

When you reuse your home directory, you also reuse the configuration files for various programs - there are lots of them, usually dot files. You end up with executables from one system, and configuration files from another system. They don't always work, and you get weird bugs if the version of the executable doesn't match the version of the config file. In your case, X11 is breaking badly. It works in most of the cases, but when you whitelist your home directory it detects a missing file and prevents firefox from starting.

This is how you fix it: create a new user account, and move in that account only your personal files. If you want to move config files, I would say you need to merge them one by one.

<!-- gh-comment-id:219224024 --> @netblue30 commented on GitHub (May 14, 2016): When you reuse your home directory, you also reuse the configuration files for various programs - there are lots of them, usually dot files. You end up with executables from one system, and configuration files from another system. They don't always work, and you get weird bugs if the version of the executable doesn't match the version of the config file. In your case, X11 is breaking badly. It works in most of the cases, but when you whitelist your home directory it detects a missing file and prevents firefox from starting. This is how you fix it: create a new user account, and move in that account only your personal files. If you want to move config files, I would say you need to merge them one by one.
Author
Owner

@ghost commented on GitHub (May 16, 2016):

for others that might run in to the same problem.

kind of figured out what's the problem.
"xhost +" allows running firejail normally. (temporary solution, it just drops a security check and you must rerun the command everytime you login)
The whitelist is probably a consequence of this.

xhost gives:
"""
INET:localhost
SI:localuser:XXXX(correct)
"""
i don't know why it blocks me.

<!-- gh-comment-id:219423391 --> @ghost commented on GitHub (May 16, 2016): for others that might run in to the same problem. kind of figured out what's the problem. "xhost +" allows running firejail normally. (temporary solution, it just drops a security check and you must rerun the command everytime you login) The whitelist is probably a consequence of this. xhost gives: """ INET:localhost SI:localuser:XXXX(correct) """ i don't know why it blocks me.
Author
Owner

@ghost commented on GitHub (Sep 29, 2021):

Hi there!

You just need to export your XAuthority properly. A whitelist entry for the authority file afterwards will grant you access within the sandbox (e.g. --whitelist=/home/user/.xauthxxxxXX) [tested with GrSec/Selinux/Apparmor/su sandbox -> firejail]

Cheers!

<!-- gh-comment-id:929918218 --> @ghost commented on GitHub (Sep 29, 2021): Hi there! You just need to export your XAuthority properly. A whitelist entry for the authority file afterwards will grant you access within the sandbox (e.g. --whitelist=/home/user/.xauthxxxxXX) [tested with GrSec/Selinux/Apparmor/su sandbox -> firejail] Cheers!
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#364
No description provided.