Closed aki-k closed 2 years ago
Hi aki! I saw your Reddit thread.. I guess it's bug of WSL2 on Windows11, or just by design. The WSL session started on Windows startup seems to have some quirks. See https://github.com/nullpo-head/wsl-distrod/blob/main/docs/references.md#know-bugs
So basically this problem is not related with Distrod. I may close this issue in a while.
BTW, why do you want to start a GUI app on Windows startup? Have you tried scheduling it so that it starts when you "log in" because you cannot see any GUI apps until you log in anyway? It might solve the problem
I'm starting dockerd in WSL 2. Inside that wsl_nvidia docker container I have sshd + xpra for remote X11 access into the container. I also configure it for Nvidia container toolkit usage. I know this is a bit crazy to try to use a workstation OS as a server but there's no problem with weston if I don't use the task scheduler. Even with weston crashing I can automatically start the wsl_nvidia container and login to it. The task scheduler trigger is "At startup" of Windows.
@nullpo-head I forgot to ask whether you see weston crashing in WSL 2's dmesg after enabling systemd and starting it through the task scheduler? It'll probably also show multiple systemd-udevd processes.
@aki-k hmmm. actually, weston crash is not happening in my environment, even if I enable auto-start.
It'll probably also show multiple systemd-udevd processes
As for this, don't worry. This is how systemd-udevd works. The number of processes decreases over time, say a few minutes.
Could you check whether you see weston crashing in WSL 2 (dmesg -Tw) after enabling wsl-distrod and enabling WSL 2 to start on system start-up? I don't get any replies at https://github.com/microsoft/wslg/issues/564 and now even wrapping the startup of WSL 2 with serman (https://github.com/kflu/serman) causes the same problem for me. It's causing excess system load and I hear the CPU fan running high.
If I start WSL 2 manually, I only see one systemd-udevd in the process list. Now there are constantly 33 systemd-udevds :(
I already commented.
actually, weston crash is not happening in my environment, even if I enable auto-start.
Multiple systemd-udevd process is how it works. Exact number may be because of the weston crash, but it might be just the result of that crash, not the cause. See https://github.com/systemd/systemd/issues/11405.
Again, basically this issue is not related to Distrod, nor even to systemd, I guess. I guess you will see the same problem even if you disable systemd of any systemd solutions. I recommend you to resume the discussion on this problem in the Reddit thread.
I'm closing this issue, but here are some ideas from me.
My guess is the cause of the problem is either of the following, under the assumption is that there is a bug in Windows 11 that prevents inter operation from working on WSLs that were started before you logged in by the task scheduler.
JFYI, I've confirmed even that xcalc
starts correctly from a ssh session on a WSL instance which has started by the auto-start feature. I started up Windows 11, WSL started by Distrod's auto-start feature without login, I connected to it from another computer via ssh, I started xcalc
and it succeeded, and I saw xcalc
's window had been there after I logged in that Windows 11 machine.
I see weston crashing in "dmesg -Tw" after enabling wsl-distrod. I wrote an issue report to Microsoft's WSLg repository too a week ago.
https://github.com/microsoft/wslg/issues/564
There I used https://github.com/DamionGans/ubuntu-wsl2-systemd-script to enable systemd in WSL 2 Ubuntu-20.04 distro. Somehow the problem is related to Windows task scheduler because when manually starting WSL 2, there is no problem with weston.