I have created a Dockerfile that installs Xvfb and firefox with all the dependencies needed and I'm able to create a container with firefox launched on the DISPLAY=:1 of a Xserver.
When I try to launch another container, the second container is not able to launch a Xserver on DISPLAY=:1.
sudo docker logs docker_serv2
xvfb-run: error: Xvfb failed to start
No protocol specified
So I checked my processes with ps aux
and I was suprised to see my X server listed on my host.
xxx 11343 1.9 0.6 240260 47620 ? Sl 08:41 0:12 Xvfb :1 -screen 0 1280x720x24 -shmem -listen tcp -nolisten tcp -auth /home/xxx/.Xauthority
xxx 11350 18.7 4.2 2238084 326600 ? Sl 08:41 2:07 /usr/lib/firefox/firefox
I use this command to create the Xserver and launch firefox on both containers :
xvfb-run -n 1 -f ~/.Xauthority --server-args='-screen 0 1280x720x24 -shmem -listen tcp' firefox
I understand that docker processes can be see on the host as it is not a VM, but I do not understand why the second container is not able to launch a X server on DISPLAY=:1 too, as the two containers are not linked.
Aren't they isolated from the host system ? I thought they would use their own minimalist environnement.
Here is my run.sh
command :
docker run -d --rm \
--net=host \
-v /dev/uinput:/dev/uinput \
-v /dev/input:/dev/input \
-v /run/udev:/run/udev \
--name docker firefox
First I thought --net=host
could be the source of my problem, but it only impacts the network configuration and I have the same issue without the option.
The others -v
option are here because I'm also playing with some /dev/input instructions and are not important in this issue.
So, is it possible to launch two different containers launching two seperate X server on DISPLAY=:1 ?