Score:0

Ubuntu 22.10 (and 22.04) remote desktop on a headless machine throws me out of the session and logs off

ss flag

After some indeterminate time, usually perhaps an hour, maybe less, I get thrown off my session and I am logged off when using remote desktop. (That of course means I can't remote back in!)

I run Ubuntu 22.10 desktop on a headless HP Proliant Microserver Gen 8 machine.

I had thought it was linked to VS Code, but I have now experienced the issue when just using terminal, or Files. I cannot pin it down.

Anyone got any ideas, especially as to what logs I could look at?

It's becoming more than a nuisance :sigh

EDIT: Looking at the journalctl just before the crash I see this:

pr 27 10:25:22 XXXServer gnome-remote-desktop-daemon[1164]: [10:25:22:412] [1164:102408] [ERROR][com.freerdp.core.peer] - peer_recv>
Apr 27 10:25:22 XXXServer gnome-remote-desktop-daemon[1164]: [10:25:22:413] [1164:102408] [ERROR][com.freerdp.core.transport] - tran>
Apr 27 10:25:22 XXXServer gnome-remote-de[1164]: Unable to check file descriptor, closing connection
Apr 27 10:25:26 XXXServer sshd[102410]: Received disconnect from 119.28.107.44 port 57148:11: Bye Bye [preauth]
Apr 27 10:25:26 XXXServer sshd[102410]: Disconnected from authenticating user root 119.28.107.44 port 57148 [preauth]
Apr 27 10:25:26 XXXServer gnome-remote-desktop-daemon[1164]: [10:25:26:758] [1164:102416] [ERROR][com.freerdp.core.peer] - peer_recv>
Apr 27 10:25:26 XXXServer gnome-remote-desktop-daemon[1164]: [10:25:26:758] [1164:102416] [ERROR][com.freerdp.core.transport] - tran>
Apr 27 10:25:26 XXXServer gnome-remote-de[1164]: Unable to check file descriptor, closing connection
Apr 27 10:25:31 XXXServer sshd[102418]: Received disconnect from 208.109.38.20 port 50896:11: Bye Bye [preauth]
xxx@XXXServer:~$ sudo journalctl  --since="-2 minutes"
Apr 27 10:30:56 XXXServer kernel: Linux version 5.19.0-40-generic (buildd@lcy02-amd64-029) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3>

I changed the name of the server. None of the ip addresses mean anything to me.

user535733 avatar
cn flag
Smells like a possible *desktop crash*. Review your /var/crash for .crash files corresponding to the events.
waltinator avatar
it flag
Look at the system logs with `sudo journalctl -b -1 -ex` to see the end of the logs of the previous boot (leading up to the crash). Use `sudo journalctl --since="-10 minutes"` to look at the last 10 minutes. Read `man journalctl`, and read through my profile (click on my name), after the philosophy/rants, I have hints to make `journalctl` easier.
waltinator avatar
it flag
Does your "Remote desktop" or the session on the target have an "idle timeout" or "Keep-Alive" setting?
gfmoore avatar
ss flag
/var/crash/_usr_lib_xorg_Xorg.1000.crash is empty.
gfmoore avatar
ss flag
I'm starting to look at the system log, but I'll now have to wait till it crashes again so I can see what happens. :) I don't think any shutdown timer is running on rdp - I checked the gpedit. I've looked at the Ubuntu side and using dconf editor adjusted anything I could find that hinted at timeout. I'll update asap. Thanks all.
gfmoore avatar
ss flag
Well the log was interesting once I looked through it. It looked like someone(s) was tying to gain access to my server on ssh, probably trying a password cracker and I guess after so many tries it is disconnecting? I have now learnt how to set up ssh using an encryption key and blocking password access. I'll see how it goes...
gfmoore avatar
ss flag
Nope that didn't solve it, just been thrown off this am. Looking through log now, but man there's a lot isn't there. Any ideas of what to look for? Is there some kind of log off or lock line?
gfmoore avatar
ss flag
Added extract from journalctl to original question - actually not sure how you add additional information that doesn't fit in a comments box?
Score:0
ss flag

Well I eventually found the problem, by accident. In trying to figure out how to stop all these ssh attacks I noticed that in the firmware for my HP Proliant Microserver Gen8 machine (that uses ssh!!!) that there was an option where the the ILO 4 (Integrated Lights Out) console would disconnect after 30 minutes of inactivity. I've set that to infinity and hopefully that will sort it. This console is useful as it shows what would be on the screen and I can restart the server from it, but useless in that the mouse lags incredibly - another problem)

My next problem is to wonder why I'm starting to find that Remote Desktop is showing a screen with todays date on it and I have to click to get a logon screen. Fortunately I had installed some extension which allowed log in from a locked terminal.

It should just show the autologged in screen! as it always had. This was happening before the fix above.

For those who find themselves locked out of rdp an approach that I found was to ssh in and run the command

sudo systemctl restart gdm.service

gdm is the gnome display manager I think (used to be lightdm or something)

This then allowed me back in through rdp. (Thanks to chatGPT for giving me some clues on this).

:lol

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.