Mrview in remote server and openGL?

mrview works fine in local and doesn’t work in remote. Of course, this is due to OpenGL >3 not being available on X11 or X2go. I found an old post that suggests using Virtual GL.

Is this the best solution so far, any other tips or documentation on how to achieve this? Maybe it’s worth adding something in the MRtrix documentation.

I know some people use a local mrview to open remote files, but with 2Gb+ of tract files it’s difficult to work this way.


This is unfortunately a bit of a complicated situation at the moment, mostly because there’s a lot going on behind the scenes, with Linux gradually moving away from X11 in favour of Wayland, and the open-source mesa drivers now offering some level of support – although undocumented and unofficial, as far as I can tell. So sometimes, under certain conditions and when the planets are aligned, standard X11 forwarding works out of the box – but I can’t figure out what these conditions actually are…

In the meantime, yes, there are other options such as VirtualGL, but also OpenGL-capable VNC servers – see this thread for some inspiration. All of these solutions however require that the rendering be performed on the remote server – not your local workstation. That means your HPC cluster needs to be equipped with the right drivers for OpenGL 3.3 rendering, and preferably also a decent enough graphics card to give you decent hardware acceleration. Otherwise, all the rendering will be performed using software rasterisation, which may in some circumstances be just as slow as simply downloading the data and displaying it locally (depending of course on the speed of your network).

To summarise: it’s messy, and I wish it had all been worked out by now. Sadly, we’re still some way off…

After canvassing the internet, this worked for me on Windows remote machine with mrtrix installed on Windows local machine.

Assuming that, when you access it remotely, mrview works normally when the mrview window was already open locally via the MinGW 64-bit shell .

  1. Launch mrview via TeamViewer remote connection that works fine.

2. If you now want to open a new mrview window on the host via Remote Desktop Connection, from your remote location, the logic is: disconnect from your remote session and allow mrview to launch on the local machine, then reconnect remotely again.

While remotely connected to your local machine:

Run msys2 terminal as administrator, else it won’t work. I have got the msys2 pinned on my taskbar so I just right click the icon, then right click it again to choose Run as administrator. Then choose the Mingw-w64 64bit as usual

  1. Get the active session number by typing $ query session in the terminal. Here mine is 2
  2. write script in e.g. Notepad

tscon 2 /DEST:console /password:yourloginpassword

  1. save it i.e. C:\msys64\home[me]\
  2. in mysys terminal type $./

this will disconnect you, lauch mrview locally. And all you then need to do is reconnect remotely and you should find mrview window open. In this configuration I don’t have problems with 3D rendering.