Nvidia driver breaks vncserver on CentOS 7.4, is there a work around

centos7nvidiavnc

CentOS Linux release 7.4.1708 (Core) 
uname -r output: 3.10.0-693.2.2.el7.x86_64
NVidia driver: NVIDIA-Linux-x86_64-375.66.run

When using the Nvidia graphics card driver with the Nvidia GeForce GT 720 graphics card on CentOS 7.4 it works fine for the wired computer monitor on the console. However, when attempting to connect to the vncserver, you only get a blank black screen on connection. I have removed the Nvidia driver, and VNC works again. Apparently I just recently found out that the Nouveau driver works with VNC, but it doesn't with the wired computer monitor on the console.

Is there a work around for using the Nvidia driver and be able to get VNC to work? Possible configuration files changes or a simpler GUI to use with Gnome? Currently I'm using metacity in the ~user/.vnc/xstartup file. Or is there another good alternative to using the vncserver/tigervnc?

Best Answer

TurboVNC + VirtualGL is a good alternative.

Pros:

The cons is that it might be tricky to config. I've just finished setting it up on my CentOS 7 and NVidia K80. I doubt my config is perfect, but here's a set of points I'd like to highlight:

  1. Official guides (1,2,3,4) might look somewhat too long and scary at the first glance, but they are rather easy to follow. They do miss some important pieces of information, though (1,2,3,4).

  2. I've used kmod-nvidia drivers from elrepo, blacklisting nouveau with two lines echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/disable-nouveau.conf, not with one single-line, like suggested in many other guides (1,2).

  3. Checking the following logs is a good starting point, when something goes wrong: /var/log/messages, /var/log/Xorg.0.log, ~/.vnc/*.log. Most error messages I ran into are already discussed and rather easy to google.

  4. Pay attention to the xdpyinfo -display :0 sanity check there. If it's not working, try answering n/n/n in vglserver_config and disabling selinux. Also, personally, I ended up replacing gdm with lightdm.

  5. Although in general Gnome3 works OK, some weird errors do happen time-to-time (e.g. Firefox works, but opening downloaded archive with the built-in archive manager fails with an error like this). So, I ended up installing KDE Plasma, so that -3dwm is no longer needed. (But I still like TurboVNC server, cause it's fast).
Related Topic