On Ubuntu this problem is caused by the gpu-manager that keeps on rewriting xorg.conf incorrectly for the Optimus NVIDIA / Intel setup.
I analyse the problem and present a hacky work-around in this post: http://vxlabs.com/2015/02/05/solving-the-ubuntu-14-04-nvidia...