microsoft / wslg

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

Running weston before any X apps first prevents X apps from running #565

Open slaterd314 opened 2 years ago

slaterd314 commented 2 years ago

Environment

Windows build number: 10.0.22489.1000
Your Distribution version: Ubuntu 18.04
Your WSLg version: 1.0.27

Steps to reproduce

at a command prompt, run start wsl in the wsl terminal, run: weston Close the weston window, then run xeyes Results in this output: Error: Can't open display: :0 Then run: ls -la /mnt/wslg/.X11-unix

And note the directory is empty.

Note: If I first run xeyes, then run weston, everything works as expected.

WSL logs: stderr.log versions.txt weston.log

Expected behavior

xeyes should run

Actual behavior

Error: Can't open display: :0

hideyukn88 commented 2 years ago

@dslater38, thanks for trying out WSLg. I would like to clarify a few things, based on repro steps, it looks you manually launch weston inside Ubuntu,

1: First, in WSLg, weston will be launched automatically inside separate system-distro as diagram at https://github.com/microsoft/wslg#wslg-architecture-overview shows. Do you intend to run your own weston or one from Ubuntu repo?

2: Second, running own weston in user-distro, is actually possible in WSLg, as long as you disabled system-distro entirely, so there won't be any conflict. I personally run my own build of weston on Ubuntu directly without system-distro, to make sure our weston remain compatible with another Linux distro (since system-distro uses Microsoft's Mariner Linux distro).

3: Then if you expect weston to run properly with Windows host with desktop integration, you will need the weston from our fork tree https://github.com/microsoft/weston-mirror, and run with proper configuration, if this is still your interest, please let us know, we can put some info together in Wiki. If you need to run weston from Ubuntu repo, you can only run full-desktop remoting (Linux desktop in a Windows's window) with very limited integration.

Thanks!

slaterd314 commented 2 years ago

Yes, I was manually running /usr/bin/weston My intention was not to run my own weston or the Ubuntu one, although apt search reveals that I do have Ubuntu's weston installed: weston/focal,now 8.0.0-1 amd64 [installed] reference implementation of a wayland compositor

I was just trying out some weston apps.

I'm definitely interested in trying out item 3, i.e. using your weston-mirror. I wiki page would definitely be welcome.

Even so, don't you think it's still a bug that running, as a normal user, xeyes, then weston works, while running weston first breaks running x applications?

hideyukn88 commented 2 years ago

@dslater38,

First, if your purpose is simply to run some Wayland native application or samples came with weston package (such as weston-terminal), then those should be able run without launching manually weston inside Ubuntu since Wayland compositor is already running inside WSLg's system-distro.

Second, if you want to run separate instance of weston (and X server) side by side with the one running inside system-distro, then I believe those need to be properly configured, such as not conflicting WAYLAND_DISPLAY and DISPLAY, or GUI support in WSL needs to be disabled by .wslconfig, thus no weston to run from system-distro, then the weston launched from Ubuntu will be sole Wayland compositor.

Thanks!

slaterd314 commented 2 years ago

So actually, I was just running weston as a nested server - i.e. using the wayland-backend.so backend. However, the weston app itself wasn't really a good example for this issue, as I see the same issue if I run weston-terminal before running an X application..

aki-k commented 1 year ago

@hideyukn88

2: Second, running own weston in user-distro, is actually possible in WSLg, as long as you disabled system-distro entirely, so there won't be any conflict.

How is that done? I'm having a problem with weston crashing once a second in the system distro when wsl 2 is started through the task scheduler.

anr2me commented 1 month ago

@hideyukn88

2: Second, running own weston in user-distro, is actually possible in WSLg, as long as you disabled system-distro entirely, so there won't be any conflict.

How is that done? I'm having a problem with weston crashing once a second in the system distro when wsl 2 is started through the task scheduler.

It's there at https://github.com/microsoft/wslg#wslg-system-distro