Score:2

Ubuntu 22.04 Slow Login (first time after powering on)

us flag

I am now literally insane trying to fix this issue of slow login (not boot). The booting finishes in 20 seconds or less. However, after I punch in my password and press enter to login it takes roughly a minute or more to login. Even after login it takes a while for the desktop to settle in so I can use it peacefully.

I tried the following in desperation:

  1. Create another user: Same result of slow login after powering on
  2. Tried both Ubuntu / Ubuntu on Xorg: Same result of slow login after powering on
  3. My .xsession-errors is empty with nothing to log
  4. Tried removing everything inside /var/crash with sudo rm /var/crash/*.
  5. Reinstalled only Ubuntu without formatting my /home/ directory and still nothing.
  6. Tried to install KDE but still the same (done before formatting adventure)

Edit 1(15-11-2022):

I forgot the mention the storage specs of my machine, which I believe is crucial to this problem perhaps. My /home partition lives in the 2TB HDD, while the rest of the / partition lives in my 2TB NvME SSD. Thought I should share this information as well.

Below is my uname output

Linux 5.15.0-52-generic x86_64

Below is my lshw output

Pastebin link because of askubuntu character limit of 30000

Below is my systemd-analyze output

Startup finished in 3.502s (kernel) + 7.258s (userspace) = 10.760s 
graphical.target reached after 7.234s in userspace

Below is my systemd-analyze critical-chain

graphical.target @7.234s
└─multi-user.target @7.234s
  └─kerneloops.service @7.227s +6ms
    └─network-online.target @7.225s
      └─NetworkManager-wait-online.service @1.054s +6.170s
        └─NetworkManager.service @1.012s +41ms
          └─dbus.service @1.010s
            └─basic.target @1.005s
              └─sockets.target @1.005s
                └─snapd.socket @1.005s +314us
                  └─sysinit.target @1.002s
                    └─systemd-timesyncd.service @684ms +297ms
                      └─systemd-tmpfiles-setup.service @667ms +14ms
                        └─local-fs.target @665ms
                          └─run-snapd-ns-snapd\x2ddesktop\x2dintegration.mnt.mount @2.145s
                            └─run-snapd-ns.mount @1.815s
                              └─local-fs-pre.target @167ms
                                └─keyboard-setup.service @136ms +30ms
                                  └─systemd-journald.socket @133ms
                                    └─system.slice @131ms
                                      └─-.slice @131ms

Below is my systemd-analyze blame

6.170s NetworkManager-wait-online.service
3.666s user@1000.service
2.797s plymouth-quit-wait.service
 385ms modprobe@chromeos_pstore.service
 313ms systemd-resolved.service
 303ms systemd-fsck@dev-disk-by\x2duuid-59abd4ad\x2d6be4\x2d4e9f\x2da19e\x2dcbc6469d8862.service
 299ms systemd-oomd.service
 297ms systemd-timesyncd.service
 278ms snapd.seeded.service
 257ms snapd.service
 245ms udisks2.service
 210ms snapd.apparmor.service
 170ms proc-sys-fs-binfmt_misc.mount
 155ms dev-nvme0n1p2.device
 119ms apport-autoreport.service
 116ms cups.service
 109ms networkd-dispatcher.service
  86ms apparmor.service
  82ms boot-efi.mount
  79ms gpu-manager.service
  78ms geoclue.service
  78ms dev-loop9.device
  73ms dev-loop5.device
  71ms e2scrub_reap.service
  71ms dev-loop7.device
  71ms dev-loop6.device
  70ms dev-loop4.device
  70ms systemd-udev-trigger.service
  69ms dev-loop8.device
  68ms upower.service
  68ms accounts-daemon.service
  68ms dev-loop3.device
  68ms dev-loop12.device
  67ms dev-loop11.device
  67ms dev-loop10.device
  67ms dev-loop0.device
  66ms dev-loop2.device
  65ms systemd-logind.service
  63ms dev-loop13.device
  63ms dev-loop1.device
  62ms dev-loop14.device
  50ms systemd-journald.service
  49ms update-notifier-download.service
  46ms ModemManager.service
  43ms systemd-journal-flush.service
  43ms systemd-udevd.service
  41ms NetworkManager.service
  40ms secureboot-db.service
  34ms power-profiles-daemon.service
  31ms systemd-fsck@dev-disk-by\x2duuid-A9EA\x2d3145.service
  30ms keyboard-setup.service
  29ms avahi-daemon.service
  28ms apport.service
  28ms switcheroo-control.service
  27ms polkit.service
  27ms ubuntu-advantage-desktop-daemon.service
  25ms gdm.service
  24ms colord.service
  22ms packagekit.service
  19ms snap-bare-5.mount
  19ms plymouth-start.service
  18ms thermald.service
  18ms snap-core20-1634.mount
  18ms grub-common.service
  18ms snap-core20-1695.mount
  17ms snap-firefox-2058.mount
  17ms systemd-modules-load.service
  16ms home.mount
  16ms snap-firefox-2067.mount
  15ms snap-gnome\x2d3\x2d38\x2d2004-119.mount
  15ms snap-gnome\x2d3\x2d38\x2d2004-99.mount
  15ms wpa_supplicant.service
  14ms systemd-tmpfiles-setup.service
  13ms snap-gtk\x2dcommon\x2dthemes-1534.mount
  13ms systemd-tmpfiles-clean.service
  13ms snap-gtk\x2dcommon\x2dthemes-1535.mount
  12ms snap-snap\x2dstore-575.mount
  11ms snap-snap\x2dstore-599.mount
  11ms modprobe@drm.service
  11ms user-runtime-dir@1000.service
  11ms snap-snapd-15177.mount
  10ms plymouth-read-write.service
  10ms rsyslog.service
  10ms dev-hugepages.mount
  10ms snap-snapd-17336.mount
   9ms dev-mqueue.mount
   9ms sys-kernel-debug.mount
   9ms snap-snapd\x2ddesktop\x2dintegration-10.mount
   9ms alsa-restore.service
   9ms sys-kernel-tracing.mount
   8ms snap-snapd\x2ddesktop\x2dintegration-14.mount
   7ms grub-initrd-fallback.service
   7ms kmod-static-nodes.service
   6ms var-snap-firefox-common-host\x2dhunspell.mount
   6ms kerneloops.service
   6ms modprobe@configfs.service
   6ms systemd-sysusers.service
   6ms systemd-tmpfiles-setup-dev.service
   5ms systemd-sysctl.service
   5ms modprobe@fuse.service
   5ms systemd-remount-fs.service
   4ms systemd-random-seed.service
   4ms systemd-user-sessions.service
   3ms systemd-update-utmp.service
   3ms openvpn.service
   2ms systemd-update-utmp-runlevel.service
   2ms swapfile.swap
   2ms console-setup.service
   2ms rtkit-daemon.service
   1ms modprobe@efi_pstore.service
   1ms sys-fs-fuse-connections.mount
   1ms modprobe@pstore_blk.service
   1ms sys-kernel-config.mount
   1ms setvtrgb.service
   1ms modprobe@ramoops.service
   1ms modprobe@pstore_zone.service
   1ms ufw.service
 314us snapd.socket

I simply do not understand why the boot is really fast but the login is terribly slow. Due to this I am not even switching off my machine for days. I am literally trying to kill myself to fix this issue. Not sure if this is a duplicate because I have travelled to every corner of the internet universe searching for an answer(askubuntu, various forums, youtube, google, ecosia, shodan trust me they are search engines as well) but still nothing (please bear with me if I still missed any solutions out there).

The only option I haven't explored is black, white, violet, or any other color damn magic.

Let me know if you need any other information related to my desktop.

Regards,

#0K

PonJar avatar
in flag
In your research did you find this question, the answers have solved similar issues. https://askubuntu.com/questions/1412712/slow-login-first-attempt-on-ubuntu-22-04
Srinivasan Ramachandran avatar
us flag
Hey many many thanks for your reply. Yes, indeed I am aware of this answer as well. However, my video card is Radeon. So did not pay any further attention to this answer as the problem seems to be coming from nvidia gpu drivers. Thanks again for your time.
PonJar avatar
in flag
Nothing in the journal to give you a clue? `journalctl -p 3 -b` or `journalctl -p 4 -b`. Will give you errors (or worse) and warnings (or worse) respectively for the current boot. Should be able to see any relevant messages with a time stamp that matches your waiting period between login and desktop
Srinivasan Ramachandran avatar
us flag
@PonJar Wow, many thanks for teaching me the essence of journalctl. I saw the man page and found out you are asking for errors and warnings with 3 and 4. I also tried 2 for critical, 1 for alert and 0 for emergency. But nothing for 0 and 1. For 3 and 4 below are the outputs. Now I am searching for information related to each and every errors for a clue. However, please tell me if you find something odd. #output of journalctl -p 3 -b https://pastebin.com/1sn3mGeT #output of journalctl -p 4 -b https://pastebin.com/L93iGFa7
Srinivasan Ramachandran avatar
us flag
@PonJar Here is the complete log of journalctl with -p=4 https://pastebin.com/YDAa7HXh From your advice I can see the time it takes by comparing the timestamp between each error/warning messages. It is indeed more than a minute according to the latest journalctl boot log
PonJar avatar
in flag
Don’t expect to “fix” everything in these journals. Most of the messages are not a problem. Focus on the level 3 output. The Failed to start Service for snap application snapd-desktop-integration looks worth investigating.
Srinivasan Ramachandran avatar
us flag
Sure I'll start with that. But if you are the logs it does take more than a minute to login. But the time to reach login screen is here seconds. I am worried baffled by this
Srinivasan Ramachandran avatar
us flag
@PonJar I removed all the snaps and still no improvement.
PonJar avatar
in flag
Have you looked at the bluez error? That is to do with Bluetooth. Do you expect Bluetooth to be operational on your machine?
Srinivasan Ramachandran avatar
us flag
I don't even have Bluetooth on my desktop machine:-(
PonJar avatar
in flag
Have you disabled the bluetooth service? (line 6 in the "-p 3" output) This question seems to be relevant https://ubuntuforums.org/showthread.php?t=2336447
Srinivasan Ramachandran avatar
us flag
Yes I did that but to no effect. :-(
PonJar avatar
in flag
Are you using NFS or a NextCloud client or anything similar that connects to remote storage?
Srinivasan Ramachandran avatar
us flag
I am not aware of using any of those services. So it's possible I am not using them
PonJar avatar
in flag
I’ve re-read your question tonight and would suggest you try moving your home files to the SSD. There are plenty of config files in there that could impact performance (since so much else has been eliminated). If this makes a difference and you have large files on the HDD you could reorganise them such that the HDD is mounted to a folder inside home. Your config files are probably in hidden directories within home with names that start with a dot.
I sit in a Tesla and translated this thread with Ai:

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.