Skip to content

docker_graphics_linux

Colley JM edited this page Aug 21, 2023 · 10 revisions

Docker options to enable graphics on linux

Solution 1

--net=host -e="DISPLAY" -v="$HOME/.Xauthority:/root/.Xauthority:rw"

Tested on :

  • ubuntu 20.04

Failed for :

  • ubuntu 18.04

Reference:

Solution 2

Do before docker run

xhost +

options for docker run

-e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix

Do after docker run

xhost -

Tested on :

  • ubuntu 20.04
  • ubuntu 18.04

Check

python -m tkinter

Reference:

Clone this wiki locally