¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Running TWS Gateway under WSL2


 

As many may know, Windows 10 and 11 now officially supports running Linux GUI software. I have attempted to run TWS Gateway under WSL2 Ubuntu 22.04 but it failed with a cryptic GTK error: `?gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed`. The solution is to append `GDK_BACKEND=x11` to the invocation command, i.e. `GDK_BACKEND=x11 ./ibgateway`. I am documenting it here for posterity, in case anyone else runs into the same problem.


 

Thanks.
I think, `export GDK_BACKEND=x11` and subsequently calling ibgateway (or tws) solves the problem, too.
Then automation via IBC should work, too.

FYI:
We set up the TWS/ibgateway in a LXD-Container running in the WSL2 environment. So far, we did no to run into this feature.
The container is build using the ib-container-script (). Option is to forward the screen via x2go and access it from windows (and also remotely)

hartmut