Linux – How to OpenGL graphics be displayed remotely using VNC

linuxopenglvncwindows

I am attempting to run a program that uses OpenGL to render a model in a viewport through VNC unsuccessfully.

The error message I receive is – Xlib: extension "GLX" missing on display ":1.0".

It was my understanding that VNC can be configured to render all graphics remotely and send a compressed screen grab from the display buffer to the local client. This would seem to negate the need for GLX extensions on the local client. Can VNC be configured this way and could you briefly describe how?

Remote host:

vncserver on RHEL 5

Local client:

UltraVNC on Windows XP

Best Answer

I'm using x11vnc to gain remote access to whatever the monitor is displaying. x11vnc talks to the local X11 server and copies the framebuffer from the server to the client via vnc. Since the local X11 server renders everything with hardware acceleration, I get hardware accelerated OpenGL over VNC, even with all the cool desktop effects. This is how I start x11vnc:

x11vnc -rfbauth ~/.vnc/passwd  -display :0 -forever -bg -repeat -nowf -o ~/.vnc/x11vnc.log

I think almost any vnc viewer works, but I'd recommend turbovnc or tigervnc. I tried VirtualGL first, and it works fine, but not for the whole desktop, only for individual OpenGL applications.

It is even possible to change resolution on the display/vnc using xrandr. E.g. like this:

xrandr -q (to see available modes and outputs)
xrandr --output DVI-I-0 --mode "1024x768" (change mode on DVI output)

(It is possible to add new resolutions if the available modes aren't enough, but that's outside the scope here.)

So now I have a fully OpenGL hardware accelerated and resizable VNC session.