If you have recently installed Ubuntu (especially Ubuntu Server or a minimal desktop build) and notice that your computer hangs on a black screen or the purple splash screen for exactly 2 minutes during every reboot, you are likely experiencing a network configuration issue. During boot, a systemd service called NetworkManager-wait-online.service runs in the background.
This service forces the boot process to pause until a fully functional internet connection is established. If your PC is not connected to an ethernet cable, or if it takes a few moments for your Wi-Fi to authenticate, this service will patiently wait until it hits its maximum timeout (usually 120 seconds). Unless you are running a server that absolutely requires network access before starting local applications, you can completely disable this wait service to drastically speed up your boot times.
How to Disable the Wait-Online Service
You can prevent this service from running using standard systemctl commands in the terminal.
- Open your Terminal (Ctrl + Alt + T).
- First, verify that this service is actually the cause of your slow boot times by checking the systemd blame logs:
systemd-analyze blame - If you see
NetworkManager-wait-online.serviceat the very top of the list taking several seconds or minutes, proceed to disable it. - Type the following command and press Enter:
sudo systemctl disable NetworkManager-wait-online.service - Next, you should mask the service to ensure that no other dependent application accidentally triggers it during the boot process:
sudo systemctl mask NetworkManager-wait-online.service
(Note: You will be prompted to enter your administrator password for these commands).
Restart your computer. Your Ubuntu system will now boot directly to the login screen as fast as your SSD allows, regardless of whether your network adapter has finished negotiating an IP address with your router.