Cygwin/X ssh X11 forward with OpenGL

XWin, the X server for cygwin is able to render OpenGL both by software or hardware with direct and indirect context.

https://x.cygwin.com/docs/ug/using-glx.html

By default, the server uses multiwindow mode, -wgl option (hardware acceleration) and direct context. These choices can lead to encounter troubles when executing remote OpenGL based applications using X11 forwarding on ssh (X and Y for X11 and X11 trusted apps, C for compression… can be omitted) :

Host>$ ssh -XYC me@Server
Server>$  glxgears     --> don't work
Server>$  qtcreator    --> neither !

From my experiences on my system (win10 on laptop without real GPU card), using  -noglx option on indirect context works fine.

As the option LIBGL_ALWAYS_INDIRECT seems to be set to 1 by default by cygwin, it is not necessary to export it again. But the X server must be started using indirect and no hardware.

To do so, open a first cygwin terminal (not a X one!) and launch the XWin server and the client by :

Host>$ startxwin -- +iglx -nowgl

Notice that after the “- -” (2 minus sign) are the server options as for startx.

On a new cygwin terminal, first export the display to the port used by XWin (should be :0.0, see the output of the previous command)

Host>$ export DISPLAY=:0.0

Then connect to the Server enabling X11 forward :

Host>$ ssh -XYC me@Server
Server>$ glxgears    --> should work (2400 FPS ..????)
Server>$ qtcreator  --> work fine but the first rendering is black... move the mouse to find menus ;)

For lucky guys, startxwin creates tray applications (see /etc/X11/Winrc) so you can directly launch xterm which will perform the export display automatically.

Today, I use the all in one solution MobaXterm : https://mobaxterm.mobatek.net/


Posted

in

by

Tags: