Is it possible to run x11 server inside docker containers running on headless server. So that I could use gui applications inside them. What I mean by that is I have a single container which is my main desktop and others which are used to run software as firefox or chrome. Much like qubes os but without spinning up a whole new vm.
It is possible to run a headless VNC server inside a Docker container.
You may download a ready-made one from consol/ubuntu-xfce-vnc, described as:
Ubuntu container with "headless" VNC session, Xfce4 UI and preinstalled Firefox and Chrome browser
For detailed instructions on how to build such a container, see for example View a Docker container’s display using VNC Viewer from September, 2017. However, due to the rapid development of Docker this might not stay correct forever.