DesktopECHO/kWSL

New version xRDP & GCC error

devmalya-b opened this issue · 14 comments

Installed the new version, but its more unstable than the last version. the crashes still happen, but over that even gcc is not accessible? Error is get is: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function _start': (.text+0x24): undefined reference to main

Looking for a way around that, adding it to path variables etc. Will try reinstalling as well.

The bigger issue is that xRDP has stops with both the versions after a specific number of logins. The error it gives is:

connecting to sesman ip ... port ...
sesman connect ok
sending login info, please wait
login failed for display 0

it is similar to this here, and some other problems, but none of the solutions worked. Purging and reinstalling doesn't work either. Any clue how to fix the login error?

Can you give me steps to reproduce your GCC issue?

Purging and reinstalling - What do you specifically mean when you did this?

"xRDP has stops with both the versions after a specific number of logins" - Can you provide steps to reproduce?

I need more specific info to assist. None of these issues make sense or are things I have run into, using kWSL daily and extensively.

Also need to confirm you selected a different port for xRDP when you installed a new instance.

I actually uninstalled the last instance due to the xRDP error. The new instance connected to xRDP fine itself. The xRDP error can't be replicated in any way I know of. It just comes up after I have shutdown WSL too many times without running wsl --shutdown. One way could be to reduce the maxsessions in xrdp.ini but I'm not sure of it. Here, here, and here are some other instances of the same error.

As for GCC in the new instance, you can probably replicate it (given it is a non defunct bug) by just trying to compile a C file, or with ls /usr/bin | grep gcc which had no output for me.

If you're seeing this xRDP error then wsl --shutdown isn't properly terminating the instance.

Instead try wslconfig /t NeonWSL (Or whatever you named the instance)

Regarding your GCC issue, can you try rebuilding an Ubuntu/Neon package to verify your environment is ok? Sounds like you don't have the necessary development tools installed:

sudo apt-get install devscripts debhelper autoconf build-essential dpkg-dev

I have shutdown WSL too many times without running wsl --shutdown.

This might be a WSL2 issue as well. Can you try running the instance in WSL1 first and see if the issue persists? It shouldn't, because there's a logout script in KDE that shuts down WSL completely so new sessions are 'clean'

The development tools installation worked. Not sure why I needed it, since I've always been able to compile right off the bat on previous versions and other distros.

This might be a WSL2 issue as well. Can you try running the instance in WSL1 first and see if the issue persists? It shouldn't, because there's a logout script in KDE that shuts down WSL completely so new sessions are 'clean'

What do you mean by a logout script? (When I said I shutdown without wsl --shutdown, I meant I shutdown windows with the WSL running as it was. Is there a way to log out of KDE which terminates the xrdp service as well? And that too just on WSL1 or 2 as well?

(Also, wslconfig /t does not free the Vmmem service from the task manager i noticed. Only wsl --shutdown seems to do that.) Is there some universal way where I can free all the memory, terminate all services including xrdp and shutdown the wsl instance together before shutting down windows?

And finally, no matter what precautions exist- if i do face this problem again, how do I really solve it? Increasing the max sessions does not work, purging and reinstalling xrdp does not work either.

When you click "Log Out" in KDE a script is kicked-off that ends the RDP session and terminates the WSL instance.

wslconfig /t Does terminate VMMEM process, but if you look in Task Manager you'll see Windows will take 15-60 seconds to end the process.

I have no idea what's wrong with your xRDP setup. You mentioned in your logs seeing
login failed for display 0
Which makes absoloutely no sense as xrdp-sesman has an offset starting at :10.

When you click "Log Out" in KDE a script is kicked-off that ends the RDP session and terminates the WSL instance.

Could you tell me where exactly is the option to do this? I seem to not have this option in my main menu, and I've never used KDE natively. Here is a image of my menu.

image

image

...Or restartwsl from the terminal.

When you click "Log Out" in KDE a script is kicked-off that ends the RDP session and terminates the WSL instance.

So I did try logging out with that button as well as tried restartwsl from the terminal, but even after that trying out wsl -l -v on cmd shows that the instance is still running, and trying sudo service xrdp status shows that both xrdp and sesman are running (even after 5 minutes). How did you make the log out button terminate the wsl instance?

/usr/local/bin/restartwsl kicks-off schtasks.exe /run /tn NeonWSL

As well, in your install folder there's Init.cmd
Try changing "Start-Sleep 3" to 15, 30 or 60 seconds instead of 3.

Try changing "Start-Sleep 3" to 15, 30 or 60 seconds instead of 3.

This worked. Now clicking the Log Out button on KDE does terminate the instance. I'm hoping it terminates the xrdp service before doing so, although only time will tell if I face the previous error again. Thank you for the assistance!

Glad to hear your issue is sorted. What value for start-sleep worked for you in the end?

@DesktopECHO So in the beginning 15 worked out. The VMMEM process would terminate itself. But as time progresses, I've to keep increasing the time for the instance to even close (wsl -l -v shows it's running). 30 does not work anymore so I'm using60 now. Only wsl --shutdown terminates the process now