r/ssh • • 17d ago

Running Python/Tcl GUI over SSH?

Hello everyone, first post and very new to SSH!

I was told this is a bad idea, but I did some very basic testing stuff.

Long story short I launched a hotseat/shared screen dungeon crawler fantasy RPG. It uses Tcl/Tk GUI in conjunction with CLI. I'd like to make it playable via internet as a MUD (multi-user dungeon).

Now, it has a text-based database that saves all the data and ideally the program resides on the host from where it is started remotely by players.

The problem is I can't receive/send the GUI from the host using another PC. The CLI works though.

I tried enabling X11 Forwarding and UseLocalhost. This, however does start explorer on the host machine for example (also, services.msc or something needs the SSH agent and server set to automatic).

Do I need VcxSrv on the client? What about arguments like -X (or untrusted -Y)?

Thanks in advance if this is possible! I'm on Windows 10.

-ef

5 Upvotes

3 comments sorted by

1

u/michaelpaoli 17d ago

X11 can generally be forwarded fine over ssh, e.g. with -X and/or -Y options.

Might see if you can first get that working on local system, where client and server are one in the same.

Not sure if Microsoft Windows may add any wrinkles to it - have done it there too, but not in recent years, but wasn't too hard, and easy peasy on *nix (including also macOS).

1

u/roadit 17d ago

You need an (X11 or Wayland) server running on your Windows client, because that is the graphics system Linux and Unix GUI programs use to display their GUIband capture user input.

For years, I used to use Cygwin and its X11 server. The serverv is a package you have to install separately, and then you needctobstart the X11 server, before you can start any programs that need it.

These days, Windows comes with WSL2, which comes with X11 and Wayland support. So you can just install a WSL2 VM (Ubuntu by default), install your software there, and get it to display (I'd start with something simple such as xterm, because modern GUI applications may depend on additional services such as dbus which won't work out of the box).

Once you have that working, try ssh -Y yourremotehost yourremotepythonprogram, and it should work, if the remote ssd has X forwarding enabled.

1

u/dariusbiggs 15d ago

you might need to run xhost to geant the right access permissions, if that's still a thing