mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #610] x11 support prerequisites are not fullfilled in some cases #427
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#427
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 @weeshy on GitHub (Jul 3, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/610
Starting isolated container in private-* environment is the first thing I think when become aware of firejail options. I run it console mode, and all worked fine. After that I've tried to run firejail with x11 support and it failed. After some trial and errors, I had factored permissions that are required to start xpra under firejail.
.1.
/etc/xpradirectory.It stores default configuration, and that configuration has no fallback in the code. So without it xpra would be malconfigured and it could not start X server properly.
.2.
${HOME}/.xpradirectory.It stores the socket that xpra uses for connection between cliect and server. Could be alternated with
--bindoption for server and--socket-dirfor client. So it is possible to create such directory on known location, possible tmpfs, and use it to pass sockets even when private or whitespace mode is enabled, and no interaction through user home directory is possible..3.
/tmpdirectoryxpra uses global tmp to communicate with local clients via mmap. It is possible to communicate through bare socket, but it would give slightly blurry image. Some optimization is enabled for passing video stream through socket, and is disabled when ussing mmap. The mmap location could be alternated with
mmap=pathoption, so it is possible to prepare tmpfs specifically for communication between firejailed xpra server and client..4.
/etc/passwd,/etc/groupfilesUsed to check for input and video groups membership, which is actual for 3d accelerated xpra sessions. If user would like to hide full information, files may be copied and reduced to hold only relevant user and groups
.5.
/etc/fontsdirectoryFontconfig is not requires but is very welcome to make fonts looks not so ugly
.6.
/etc/bumblebee,/etc/nvidiadirectoriesActual configuration for running 3d acceleration on optimus architecture.
.7.
/dev/nvidia0,/dev/nvidiactl,/dev/nvidia-modesetdevicesAccess is essential for running 3d acceleration with
optiruncommand..8.
/tmp/X11-unixdirectoryIt is required for 3d-accelerated xpra. Virtualgl firstly spawns new X server to host GPU calculation. After that client inside firejail should connect to the spawned server and uses it to run X application with GPU support, encodes and sends to xpra. The X server should be accessed through apropriate socket inside
/tmp/X11-unixdirectory. Abstract sockets and tcp sockets has no help when--net=nonefirejail option is enabled to jail application properly. In the absence of that option, abstract X11 socket with host system would be available to jailed system. That is the hardest part, because unfortunately Xorg has no option to move socket somewhere else, where it would not interfere with jailed applications..9. dbus dirty hack
There are systems where dbus is simply not installed or is not run. Or there may be firejail options enabled that prevents dbus communications between host and jailed system. What has a large sense when we talk about container isolation. There is a nasty thing in dbus, that made me hate that useful in general technology. Authors of the dbus library just could not imagine situation where their beloved creature is not available. Many users know nothing about this restriction, because they always have dbus running and available. But if for some reason, you have no dbus, your life would be occupied with nightmares.
So, when you start xpra, it import dbus libary. Just on import library tries to establish connection with dbus system. It fails and xpra application exits immediatly. xpra developer admitted that he just wanted to add extra possibilities for user to proxy dbus connection and he was upset with the fact that it become mandatory. No one in clear mind could suppose that such mature technology as dbus could not handle fails properly. But it is. As workaround xpra developer suggested to remove dbus support completly.
It could be done with
--blacklist /usr/lib/python2.7/site-packages/xpra/x11/dbusand--blacklist /usr/lib/python2.7/site-packages/xpra/dbusfirejail options. Exact xpra location depends on user distributive, so I could not suggest a hack that would work everywhere. The aforementioned locations are gentoo-specific and I could confirm that the hack works and xpra becomes happy with parts of its body dissected.I'm not sure what to do with that information. Just put on the site as documentation and workaround, or check options on software side before start and abort with meaningful error if that options are contradictory with x11 prerequisites and shadows some essential file location, or automatically adjust options to include all prerequisites for running xpra.
@netblue30 commented on GitHub (Jul 3, 2016):
Xpra is started before the sandbox is created, so it is running on the real system. I'll run into all the problems you listed here when I move Xpra itself in the sandbox - probably in the development release after the current one. Thank you for taking the time to document all this, I'll keep it in mind.