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