In this article, we will see how to solve "activation of network connection failed" error on Linux. It is not very uncommon to see this error when you boot your Linux system which might be running on a Physical server or may be running as a virtual machine on VirtualBox or VMware or on some other Hypervisor application. In my case this "activation of network connection failed" error occurred when I was trying to boot my Ubuntu 20.04 LTS on VirtualBox.
I got this error at the Login screen and wondered what went wrong. So before proceeding to solve this error I thought to write an article about this so that it will help you guys also if you are also facing the same error.
Error "activation of network connection failed" on Linux
When I started my Ubuntu 20.04 LTS from VirtualBox then I noticed that activation of network connection failed error showing at the Login screen and then the pop up disappeared immediately. When I logged in my system and tried to see the network Icon on top right corner then I was not able to see it.
Since on a Ubuntu machine, network connection is controlled by NetworkManager there is a chance that NetworkManager did not started as expected during the time system booted. So the immediate solution one can think of is to restart the NetworkManager once and see if it helps. You can restart NetworkManager by either GUI or through CLI mode. I tried to restart the NetworkManager from CLI by using
sudo systemctl restart NetworkManager command as shown below.
If there is no error with NetworkManager then it should get restarted immediately without showing any output and you should see the Network Icon appearing back on the top right corner.
Now if you try to check the network interface and the IP assigned using
ip addr sh command then you can notice that the interface
enp0s3 is now up and running with IP assigned as expected. In your case, interface might be different and may not be same as mine.
In my case, above solution worked but it is possible that the same does not work for you as the issue may be something else. If you are using any Hypervisor, then the other solution you can try is to shut down your system and then remove the network interface and add back it again. Then boot your system and see if it helps. If there are no issues with Linux Kernel then this step should help you solve the error.
It is also possible that you might be using some other Linux System like RHEL or CentOS or Rocky Linux or AlmaLinux where you are getting this
"activation of network connection failed" error. There also you can run the same command
sudo systemctl restart NetworkManager and see if it helps.
The other scenario that might be possible is that connection does not come up when you restart NetworkManager. For example, you can first check the available connection by using
sudo nmcli connection show command as shown below. Since in my case the connection name is
Wired connection 1 as you can see below.
So to bring it up I am running
sudo nmcli connection up "Wired Connection 1" command as shown below. This connection name might be different for you. You can use
sudo nmcli connection up <connection_name> syntax to bring up the connection.
If by any chance you are able to see the interface but do not see any IP assigned to it then in that case you need to run
dhclient command to get the IP from DHCP Server. If you are using any static IP then make sure that IP is free and not assigned to some other system.
Hopefully all the above steps should be sufficient to solve your
"activation of network connection failed" error. In case, if it still does not solve your problem then please let me know in the comment box. I will try to work with you.