0

Recently I did a fresh install of Ubuntu 24.04 on my Lenovo X1 Carbon gen 8. Before I had dual boot Ubuntu 23.10 and Win 10 but now I wiped the whole disk and did a clean Ubuntu only install. By setting everything to default settings (not doing anything custom), except enabling disk encryption.

When I leave my laptop for a while (eg. for lunch), when I return, it is in sleep mode and when I wake it up, after I login, all my opened windows are closed. It seems that my session has been lost completely, just like when I logout. I didn't have these issues before on 23.10. This is driving me crazy so I must solve it ASAP.

A few possibly related facts:

  • it's a dual GPU laptop (Intel onboard + nVidia)
  • I don't have nVidia drivers installed
  • I did click to install third-party drivers during install
  • my disk is encrypted
  • I don't have swap partition - I was told that Ubuntu now by default uses swap file so I just left default settings to use swap file
  • sleep settings in BIOS are already set to "Linux" mode
  • I'm using built-in display + external 24" display connected through HDMI
  • fun fact: my external display is set as main display, which means that when I turn my laptop on, the login screen will appear on main monitor but after this sleep-logout event happens, login display will appear on the laptop's screen and like this I immediately know that I've lost the session but as soon as I log-in back, everything is back to normal - my external screen becomes main one and all the settings (position, resolution, scale) are preserved
  • the only other peripheral is a Bluetooth mouse and TP Link USB-Ethernet dongle
  • the laptop is plugged-in 99% of the time
  • might not be related but occasionally it happens that, when I turn on the laptop, audio doesn't work - it just says "Dummy Output" and I have to reboot it again to make it work
  • might not be related but some of my manually added startup applications won't start every time I start the laptop, just occasionally

My questions and thoughts:

  • could it be that there's a setting to auto-logout in case of inactivity?
  • should I install nVidia drivers? I don't need the nVidia GPU
  • am I missing some other drivers?
  • are there any logs I can check AFTER this happens and when I log-in back?
6
  • Your question makes no mention of the Power Settings in the OS. Take a look there and adjust as needed.
    – David
    Commented 23 hours ago
  • @David can you be more precise? I'm switching between all the power settings as needed, but mostly using Max performance while on power, and Power saving when on battery. But nowhere I see the mention of "auto-logout". And no, I'm not planning to disable suspend, I often use suspend mode so my goal is to fix that it's not losing session when I use suspend so it's actually good for me that it automatically suspends or locks the screen during inactivity, but I want to be able to simply wake it up from sleep, log-in and continue where I left so it must not lose session on suspend.
    – XploD
    Commented 23 hours ago
  • Please edit the question and add the fact you have edited some of the power settings. Look at screen time outs as well. You can try turning off suspend for now to see what effect that has.
    – David
    Commented 23 hours ago
  • I'm not sure how this solves my issue? Disabling suspend is not an option! Suspend must work as I'm using it, this is one of the basic features of any OS. So I need to fix the bug which causes lost session on suspend, not disable suspend entirely. I also don't understand how screen timeouts are related? Yes, I want my screen to turn off because of inactivity and I want my laptop to go to sleep, but no, I don't want to lose my session. So the topic is how to prevent losing session, not anything else.
    – XploD
    Commented 22 hours ago
  • If you are not willing to troubleshoot there is nothing anyone can do to help you. I never said leave it off.
    – David
    Commented 22 hours ago

1 Answer 1

0

A long shot but I have noticed a memory leak can cause the gnome logout (end session) when memory runs out. See (and links from their): -

https://askubuntu.com/questions/1516890/automatic-log-out-even-though-all-suspend-hibernate-sleep-hybrid-sleep-lid-lock/1516958#1516958

You could force a suspend/hybernate (see link below) & revive and see if you get the same result. Possibly checking memory usage (using free) and see if memory usage is reducing.

https://askubuntu.com/questions/1792/how-can-i-suspend-hibernate-from-command-line 

(I tried suspend on my PC (for a minute or two) and it works fine. I'm afraid I don't have hybernate configured so I can't test this.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .