microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.12k stars 303 forks source link

Expose X11 tcp socket for other apps #1078

Open dimaguy opened 1 year ago

dimaguy commented 1 year ago

Is your feature request related to a problem:

It's frustrating to have to install separate software (Xming, VcXsrv, etc) to run an X11 server for other apps (like tabby) when Wslg already provides all I need

Describe the solution you'd like:

Having a TCP socket open that any program can hook into (like Tabby terminal)

Describe alternatives you've considered:

Installing other X11 server software that does so

Additional context:

No response

Biswa96 commented 1 year ago

It's frustrating to have to install separate software (Xming, VcXsrv, etc) to run an X11 server for other apps (like tabby)

And why did you install separate software to run X11 server for other apps?

dimaguy commented 1 year ago

It's frustrating to have to install separate software (Xming, VcXsrv, etc) to run an X11 server for other apps (like tabby)

And why did you install separate software to run X11 server for other apps?

As far as I can tell, it's not possible to communicate with wslg's XWayland from other windows apps outside wsl

kingosticks commented 1 year ago

Could you explain exactly what you are trying to do rather than requesting the solution you think you need. Why would Tabby require an X11 server? Isn't it a native Windows program? Are you trying to use WSL within (a Windows build of) Tabby to run X11 programs? This works out of the box.

Or are you trying to do something else?

dimaguy commented 1 year ago

Could you explain exactly what you are trying to do rather than requesting the solution you think you need. Why would Tabby require an X11 server? Isn't it a native Windows program? Are you trying to use WSL within (a Windows build of) Tabby to run X11 programs? This works out of the box.

Or are you trying to do something else?

Tabby is not just a regular terminal emulator, it also features an SSH client, and as such features X11 forwarding, but to do so, it requires a separate X11 server to work behind the scenes. Does this explanation suffice?

kingosticks commented 1 year ago

Thanks, that helps me understand.

So would an alternative be to run a Linux build of Tabby under WSL itself ?

dimaguy commented 1 year ago

Thanks, that helps me understand.

So would an alternative be to run a Linux build of Tabby under WSL itself ?

While that might be theoretically possible it's highly inefficient, mind you that Tabby is an electron app and running it native is the bare minimum for a good experience

kingosticks commented 1 year ago

Electron apps are certainly bloated monstrosities in terms of size (90MB for a terminal is ridiculous) and RAM but it might actually run ok. Anyway, it could be a quick idea to try in the meantime.

What if you install an SSH server in windows and then connect form WSL to windows with X11 forwarding?

dimaguy commented 1 year ago

Electron apps are certainly bloated monstrosities in terms of size (90MB for a terminal is ridiculous) and RAM but it might actually run ok. Anyway, it could be a quick idea to try in the meantime.

What if you install an SSH server in windows and then connect form WSL to windows with X11 forwarding?

Windows has a builtin ssh server, but for workarounds like those Id rather have a X11 server running natively, remember Im trying to cut on the hops and unneeded components and that doesn't help at all

kingosticks commented 1 year ago

You didn't mention you were trying to cut out hops, I agree they do add complexity. However, the X11 solution WSLg provides is leaps and bounds above the cruddy native alternatives we had to endure before. Best of luck with it.

dimaguy commented 1 year ago

You didn't mention you were trying to cut out hops, I agree they do add complexity. However, the X11 solution WSLg provides is leaps and bounds above the cruddy native alternatives we had to endure before. Best of luck with it.

If I weren't trying to cut hops, I'd have jumped right at the first workaround you proposed Yes, it is leaps and bounds above, hence why I'd very much like it if I just got a tcp socket to work with

sebmaynard commented 11 months ago

I use the ssh from inside wsl rather than the native ssh in Windows.

wsl ssh -X somehost

From that point, you get working ssh X forwarding without needing to install any additional X or SSH servers in Windows

Is it possible to get tabby to use something like "wsl ssh" as the ssh binary?

dimaguy commented 11 months ago

If I could just choose binaries willy nilly, I wouldn't be opening this issue in the first place.(I'd use mosh even if I could)

rkitover commented 3 months ago

I'd like to mention that there are other use cases for having a nice X11 server in native Windows, such as Cygwin and MSYS2 X11 programs, etc.. The biggest one of course is X11 forwarding over ssh. I'd very much like to see this feature too, and it should probably not be difficult to do. Also, with the port on localhost there should be no security implications.