I created docker container with X server inside. I use it for some off-screen OpenGL rendering. This container should work on any system (with or without X server running) and it should use hardware GPU if it exists (so I cannot use xvfb).
When I use this container on server-like system without GUI, everything works perfectly. But when I run the container on Ubuntu 14.04 Desktop, the screen turns off each time I start X server in my container.
I start container with --priviliged so /dev folder is shared with container. I believe it involves some kind of conflict.
Is there a way to start X inside the container such as host X server is still working?
UPDATE:
I see the following in Xorg.0.log:
AIGLX: Suspending AIGLX clients for VT switch
(II) NOUVEAU(0): NVLeaveVT is called.
UPDATE:
Can I use xvfb instead of real Xorg server? Does it support actual hardware GPU rendering?
If you don't mind using CPU for OpenGL, you can set up an X server inside the container with the Xdummy video driver with GLX extensions. But of course you won't be able to see a thing because the video driver is, well, dummy.
If you do want to play with GUIs, try TurboVNC + VirtualGL and use the Xdummy server as the 3D X server.
I don't think this is going to work - you're effectively trying to use two X servers - the host and the container - and I suspect they are both expecting to have exclusive use of the video card.
What you can do instead is use the X server on the host from the container by bind-mounting the X Server socket. This SO answer explains how: https://stackoverflow.com/a/25334301/4332
I'm not sure this will help in your particular case, but I don't entirely understand why you need an XServer running in the container at all. I think you should still have access to the GPU with --privileged.