{"id":330,"date":"2017-05-30T20:39:35","date_gmt":"2017-05-30T20:39:35","guid":{"rendered":"http:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=330"},"modified":"2021-03-25T14:04:40","modified_gmt":"2021-03-25T14:04:40","slug":"cygwinx-ssh-x11-forward-opengl","status":"publish","type":"post","link":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=330","title":{"rendered":"Cygwin\/X ssh X11 forward with OpenGL"},"content":{"rendered":"<p>XWin, the X server for\u00a0cygwin is able to render OpenGL both by software or hardware with direct and indirect context.<\/p>\n<p><a href=\"https:\/\/x.cygwin.com\/docs\/ug\/using-glx.html\">https:\/\/x.cygwin.com\/docs\/ug\/using-glx.html<\/a><\/p>\n<p>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&#8230; can be omitted) :<\/p>\n<blockquote>\n<pre>Host&gt;$ ssh -XYC me@Server\nServer&gt;$ \u00a0glxgears \u00a0 \u00a0 --&gt; don't work\nServer&gt;$  qtcreator \u00a0 \u00a0--&gt; neither !<\/pre>\n<\/blockquote>\n<p>From my experiences on my system (win10 on laptop without real GPU card), using \u00a0-noglx option on indirect context works fine.<\/p>\n<p>As the option\u00a0LIBGL_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.<\/p>\n<p>To do so, open a first cygwin terminal (not a X one!) and launch the XWin server and the client by :<\/p>\n<blockquote>\n<pre>Host&gt;$ startxwin -- +iglx -nowgl<\/pre>\n<\/blockquote>\n<p>Notice that after the &#8220;- -&#8221; (2 minus sign) are the server options as for startx.<\/p>\n<p>On a <strong>new<\/strong> cygwin terminal, first export the display to the port used by XWin (should be :0.0, see the output of the previous command)<\/p>\n<blockquote>\n<pre>Host&gt;$ export DISPLAY=:0.0<\/pre>\n<\/blockquote>\n<p>Then connect to the Server enabling X11 forward :<\/p>\n<blockquote>\n<pre>Host&gt;$ ssh -XYC me@Server\nServer&gt;$ glxgears \u00a0 \u00a0--&gt; should work (2400 FPS ..????)\nServer&gt;$ qtcreator \u00a0--&gt; work fine but the first rendering is black... move the mouse to find menus ;)<\/pre>\n<\/blockquote>\n<p>For lucky guys, startxwin creates tray applications (see \/etc\/X11\/Winrc) so you can directly launch xterm which will perform the export display automatically.<\/p>\n\n\n<p>Today, I use the all in one solution MobaXterm : https:\/\/mobaxterm.mobatek.net\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>XWin, the X server for\u00a0cygwin 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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":16,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}