I found the solution. Basically, if you run docker in VS there is no connection between the container and host’s X-server.
In the following link there are many ways to solve the issue:
http://wiki.ros.org/docker/Tutorials/GUI
I am following (for now) the 1st method that means to run:
xhost +local:root
docker run -it \
--net=host \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--volume="$HOME/.Xauthority:/home/developer/.Xauthority:rw" \
--volume="/media/Discone/Fenics/Docker:/media/Discone/Fenics/Docker" \
--workdir="/media/Discone/Fenics/Docker"\
dolfinx/dolfinx
of course the following are personal:
–volume="/media/Discone/Fenics/Docker:/media/Discone/Fenics/Docker"
–workdir="/media/Discone/Fenics/Docker"\
after working in docker container, run:
xhost -local:root
that returns access control to default.