[GH-ISSUE #4034] Any way to know we are inside Firejail or not? #2512

Closed
opened 2026-05-05 09:11:44 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @Bilb on GitHub (Mar 3, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4034

Hi,
This is not a bug report, but I did not find what I was looking in the wiki or the existing issues.
I would like to recommend my users to run my app inside Firejail, but only if that's not the case. And I would like to do that inside my app.

Is there any way to know that the app is running inside Firejail, or not?
Thanks a lot

Originally created by @Bilb on GitHub (Mar 3, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4034 Hi, This is not a bug report, but I did not find what I was looking in the wiki or the existing issues. I would like to recommend my users to run my app inside Firejail, but only if that's not the case. And I would like to do that inside my app. Is there any way to know that the app is running inside Firejail, or not? Thanks a lot
gitea-mirror 2026-05-05 09:11:44 -06:00
Author
Owner

@ghost commented on GitHub (Mar 3, 2021):

Is there any way to know that the app is running inside Firejail, or not?

Maybe you could check env, IIRC there should be a container var that equals firejail.

<!-- gh-comment-id:789470922 --> @ghost commented on GitHub (Mar 3, 2021): > Is there any way to know that the app is running inside Firejail, or not? Maybe you could check `env,` IIRC there should be a `container` var that equals `firejail`.
Author
Owner

@rusty-snake commented on GitHub (Mar 3, 2021):

$ firejail --quiet printenv | grep container 
container=firejail

or you check /run/firejail (compare ls -R /run/firejail with firejail ls -R /run/firejail and choose a file).

<!-- gh-comment-id:789475783 --> @rusty-snake commented on GitHub (Mar 3, 2021): ``` $ firejail --quiet printenv | grep container container=firejail ``` or you check `/run/firejail` (compare `ls -R /run/firejail` with `firejail ls -R /run/firejail` and choose a file).
Author
Owner

@Bilb commented on GitHub (Mar 16, 2021):

Thanks a lot, that should work

<!-- gh-comment-id:799905801 --> @Bilb commented on GitHub (Mar 16, 2021): Thanks a lot, that should work
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#2512
No description provided.