I found similar topics regarding slow kernel boot but my problem is that my system takes 3 minutes to load the userspace
systemd-analyze
gives the following output
Startup finished in 4.247s (kernel) + 3min 743ms (userspace = 3min 4.991s
graphical.target reacher after 1min 35.812s in userspace
Is there a way to identify what exactly is taking so much time? I'm running Xubuntu 18.04 in a VirtualBox and I think the problem started after I enlarged my partition (including a recreation of the swap partition).
edit:
Output of the systemd-analyze critical-chain
graphical.target @1min 35.812s
└─multi-user.target @1min 35.812s
└─docker.service @1min 32.815s +2.996s
└─network-online.target @1min 32.814s
└─NetworkManager-wait-online.service @1min 31.863s +951ms
└─NetworkManager.service @1min 31.075s +784ms
└─dbus.service @1min 30.640s
└─basic.target @1min 30.529s
└─sockets.target @1min 30.529s
└─docker.socket @1min 30.498s +30ms
└─sysinit.target @1min 30.493s
└─apparmor.service @979ms +695ms
└─local-fs.target @947ms
└─media-aj-VBox_GAs_5.2.81.mount @1min 39.649s
└─clean-mount-point@media-aj-VBox_GAs_5.2.81.service @
└─system-clean\x2dmount\x2dpoint.slice @1min 39.668s
└─system.slice @272ms
└─-.slice @266ms
What finally resolved my issue was updating the UUID of my swap partition in the /etc/fstab according to the information from Slow boot - "a start job is running for dev-disk-by..."
As I resized my primary partition I had to move my swap partion as well, seems like the system would create a new UUID but not update it in the fstab file. I'm back at a few seconds of booting time.
The answer from Alexander helped me to get the bootup messages guiding me in the right direction.