The vnc server "x11vnc" can be used for remote access to Mistika Workflows sessions running on docker containers (typically on linux servers unnatended), so we have created a small article about it.


For this article we will suppose that you already have an X session running in the host. Otherwise nothing will work as expected...


To install the vnc server, just install the x11vnc pacakge:


Example on Ubuntu/Debian:  sudo apt install x11vnc 


Before using x11vnc for the first time you should create an access password:


 x11vnc -storepasswd


(type a password, by default it will be stored in .vnc/passwd file in encrypted form)


From Now you can start the vnc server with this command:


     x11vnc -rfbauth .vnc/passwd -display :0 --forever &


Note: In rare ocassions the display will need to be :1 (or others), but this is out of the scope of this document...


Then use an vnc client to connect to the host from any other computer, so that you can see the X session remotely. For example you can use this vnc client:


https://tigervnc.org/


Once you connect, if you can't manipulate the windows because they don't have borders and controls (headless servers may not have a windows manager running...), then you can try to start a windows manager manually, as follows:


export DISPLAY=:0

sudo -b openbox 



Troubleshooting error on remote desktop sessions to Mistika Workflows containers (XCB error: 2 (BadValue):


In some environments the initial startup of x11vnc (and some windows managers such as gdm) can conflict with Mistika Workflows container communication with the X server, and you may see an error like this when trying to run workflows:


qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 1024, resource id: 580, major code: 130 (Unknown), minor code: 3


In those cases you may see GUI glitches including empty windows, menus that are not working, dialog windows not being refreshed, or just black dialogs.  To solve this:


- After a reboot, do not open the vnc connection before opening Mistika Workflows. For example, use ssh to open workflows (or the sgoActivationTool) a first time, then start x11vnc as needed.


- If you already did it wrong (and you are seing GUI glitches) , connect via ssh to kill x11vnc, restart the docker containers, and restart x11vnc. Example:


killall x11vnc

docker compose down -t 0

docker compose up -d

docker exec MistikaWorkflows workflows 

x11vnc -rfbauth .vnc/passwd -display :0 --forever &


Then reconnect with your vnc client


- In the particular case of using Gnome GDM (such as Ubuntu Desktop), just restart gdm (which will also kill x11vnc) and then restart x11vnc (you do not need to open workflows in between):


sudo gdm restart

x11vnc -rfbauth .vnc/passwd -display :0 --forever &