Skip to main content
sysadmin.my

Back to all posts

x11 Display

Published on by dab · 1 min read

Table of Contents

Show more

modify container run command

⚠️ WARNING ⚠️

  • mounting /tmp/.X11-unix directly is convenient but has some potential drawbacks:
    • you might want to (or need to) preclude MIT-SHM usage, see recommendations here
    • you might want to use something like x11docker for a more involved (and security focused) approach to running graphical applications inside containers
Terminal window
# add to volume mounts
-v /tmp/.X11-unix:/tmp/.X11-unix
# add to env variables
-e DISPLAY=unix:0
# (optional, depends on use case) add to devices
--device /dev/dri:/dev/dri