I was digging through the vncserver script and found a handy variable, TVNC_3DWM, which I am using to simplify the user experience for my TurboVNC/VirtualGL setup. It's nice that users don't need to type vglrun before every command. This capability led me down a rabbit hole...
I use the TVNC_WM variable to control how interactive the remote desktop experience is. I typically set this to mate-session or xterm, depending on how interactive we need to be.
I have been abusing TVNC_WM a bit for testing. For instance, TVNC_WM=glxgears is a quick way to test VGL.
Some people I support find it cumbersome to run an entire desktop environment when a single application is needed. A subset of those users don't even want to use an xterm window. I can use/abuse TVNC_WM to simplify their workflow, as long as the application they want to run is a binary, and as long as the application doesn't require any module loading (two very big if's in my HPC environment).
I made a wrapper script for calling vncserver, and part of this script takes an arbitrarily long list of arguments and sets them as the TVNC_WM environment variable. In practice, the script might be used like this:
or
The user can connect their local client to localhost:1 and view the terminal or opengl demo with no problem. If I write a traditional bash script, this paradigm fails:
-bash-4.2$ cat ~/my_startup.sh
#!/bin/bash
module load anaconda/Anaconda3;
jupyter-notebook
vnc_go ~/my_script.sh # doesn't work
It's pretty clear why this would fail based on the vncserver script (specifically, line 159). If I mangle the traditional bash scripting format, this script works like a dream...
-bash-4.2$ cat ~/my_startup.silly_sh
module load anaconda/Anaconda3; jupyter-notebook
vnc_go ~/my_script.silly_sh # does work
Of course, I don't want to train people to script this way. I do wonder if you might have thought about this use case before, or if you might otherwise have a suggestion on how to achieve this goal without invoking TVNC_WM.
PS- I realize VGLTransport is functionally similar to what I'm trying to achieve, but I'm still in the process of motivating the use of TurboVNC/VirtualGL over other closed source products. I want to be sure that performance is maximized for these demos; so not looking for the VGLTransport solution at this time. I want to do this with TurboVNC.