76

This problem happens sometimes when ubuntu starts up. You can't really boot to the interface sometimes.

Splash Screen with the 5 dots and a message saying:

waiting for network configuration

followed by:

waiting an additional 60 seconds for network configuration

6 Answers 6

46

I decided to go the CLI and Alt+Ctrl+F2 approach so YOU ARE FREE to do that while you are logged in to the GUI - Okay, I will write the general steps so feel free to use whatever approach you like.

  1. Edit /etc/network/interfaces:

    sudo nano /etc/network/interfaces
    
    1. If you are typing this from LXTerminal while logged in to the GUI then:

      gksudo leafpad /etc/network/interfaces
      
  2. Remove whatever written there and just keep this:

    auto lo
    iface lo inet loopback
    

It is very good idea to keep a backup copy of "interfaces" file just in case so please make sure to save a "interfaces.bak" file before you do anything

  1. Ctrl + O if you are using nano and Ctrl + S (File > Save) if you are using leafpad.

  2. Ctrl + X if you are using nano and Ctrl + Q (File > Quit) if you are using leafpad.

  3. Reboot.

  4. Done.

9
  • 3
    auto lo iface lo inet loopback doesn't work
    – draw
    Mar 7, 2013 at 17:11
  • @draw it has to be on two lines: 1st line is auto lo; 2nd line is iface lo inet loopback May 27, 2013 at 8:42
  • 2
    @danielkullmann ; auto lo; (1st line) iface lo inet loopback; (2nd line) It doesn't work for me either. I need to manually configure the interface and give its address !! Jun 27, 2013 at 6:48
  • 3
    My interfaces file looks exactly like that but the problem persists /:
    – Andy
    Nov 21, 2014 at 17:05
  • 5
    Note that this is only going to work if you have network-manager installed. It comes installed on the desktop version of Ubuntu, but not the server version. If you do not have network-manager installed, and you do this, then none of your interfaces will work
    – kbuilds
    Jan 2, 2015 at 15:54
38

In every situation that I have run into this it is a problem in /etc/network/interfaces

You should not have to remove everything as suggested in an earlier post, but rather inspect for common problems.

In my case it was defining the gateway parameter for additional ethernet IPS. You only need to define the gateway for the primary interface for each card.

What I mean by this is if your file looks like this:

auto eth0
iface eth0 inet static
  address 10.0.0.5
  netmask 255.255.255.0
  network 10.0.0.0
  gateway 10.0.0.1

auto eth0:0
iface eth0:0 inet static
  address 10.0.0.6
  netmask 255.255.255.0
  network 10.0.0.0
  #gateway 10.0.0.1

The 2nd gateway param will cause ubuntu to hang for 60+ secs during boot, you only need to define the gateway for the first eth0 section, you DO need to define the gateway for any additional nic cards, IE eth1, wlan0 etc but NOT for additional IPS assigned to the same nic. Earlier version of Ubuntu did not have any issues with this, but Ubuntu 12.04 does not like it... Be nice if it could simply ignore it.

I'm sure there are other "problems" in this file that can cause this, so you should inspect the file and make sure there are no typos etc.

5
  • 1
    The "network" option is obsolete, no longer needed.
    – jdthood
    Mar 25, 2013 at 11:29
  • 2
    this answer does not apply to me, I have no gateways in any active stanzas of this file Jul 23, 2013 at 2:41
  • 1
    I had precisely the same problem and this solution worked perfectly!
    – Sunny
    Jul 6, 2015 at 10:35
  • In my case the line beginning with "auto" contained an interface "eth2" that no longer existed i.e. was no longer configured in interfaces.
    – RTasche
    May 16, 2016 at 13:32
  • I had a similar problem where I forgot an auto p2p1.10 statement for one of my subinterfaces that are used as a bridge later in the /etc/network/interfaces file.
    – SaeX
    Nov 23, 2017 at 7:40
36

This might help too: http://tech.pedersen-live.com/2012/05/disable-waiting-for-network-configuration-messages-on-ubuntu-boot/

Basically you edit this /etc/init/failsafe.conf file and disable (comment) the sleep commands which actually pause the system. Besides accomplishing the job, at least in my case there was no error at all in the network configuration, so everything went fine.

By the way, you solution only allows to configure the loopback interface, something I could not afford in my setup (I had to manually setup the interfaces and bridges).

4
  • 3
    This should be the correct answer. A lot of people feel that the functionality of failsafe.conf is overkill
    – kbuilds
    Jan 2, 2015 at 15:55
  • Killing a failsafe never is the right answer. Fixing the wrong configuration which lets kick in failsafe is the right thing to do. There are various places where the wrong configuration can be, but it is definitively not in failsafe!
    – Tino
    Apr 17, 2016 at 9:53
  • 2
    This is the right answer in my opinion. I purposley boot without network configs when I clone servers or restore backups during emergency's. I don't need to wait 2 minutes during an emergency but there is nothing "wrong" with my configs. Oct 11, 2016 at 20:05
  • Was unable to access the URL, seems the page has gone down. It is available on archive.org: web.archive.org/web/20160301200431/http://…
    – rog
    Apr 1, 2017 at 21:16
30

The real(!) solution to this problem is following command:

sudo sed -i.old-`date +%Y%m%d-%H%M%S` '/^auto lo$/!s/^auto /allow-hotplug /' /etc/network/interfaces

In /etc/network/interfaces this changes all interfaces (except lo) from auto to allow-hotplug. This way the boot is no more waiting for the interfaces to come up first.

Warning: After this change a permanently connected interface might stay down after boot until systemd receives a real plug event. See Notes below.

Example before (look at auto eth0):

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Example after (look at allow-hotplug eth0):

auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

Notes:

  • If you mount network shares in /etc/fstab, use auto and not allow-hotplug for the interface to the network shares. Else you might see strange things happen on boot process, because network must be available prior to network share mounts. allow-hotplug does not ensure this.

  • If the interfaces are in auto mode, you express: "These interfaces are crucial for boot, so we must wait for them to come up before we have booted." Hence, if they do not come up, Ubuntu delays the boot with failsafe, waiting for them to appear for up to 120 seconds. And this is the right thing to do.

    In contrast, Interfaces which are set to allow-hotplug tell Ubuntu, that they are optional. Hence they are not essential to boot.

  • Ubuntu records which interfaces are available at install time, and assumes, that they are important for later operation. This is a conservative choice, in case the interface is later needed because some Service binds to it, as such services fail to start if they miss the interface being up.

  • There also is a kernel setting which allows processes to bind to nonexistent IPs, so you can always use allow-hotplug if you like, without harming the stability of the boot process. However, this is a completely different story.

Notes (update 2018-01-04):

  • At my side, allow-auto does the same as auto, so it does not help (tried with br0).

  • After upgrading one of my systems to Debian Stretch and switching to SystemD, boot became unbearably delayed while waiting for the (permanently connected outside) interface br0 to come up. However with allow-hotplug the interface br0 stayed down after boot. Perhaps this is caused by SystemD not receiving any real or synthetic plug event on such an interface. I did not dig deeper into this, as some obscure crontab entry @reboot /sbin/ifup br0 for root fixed it for me. (This works, but probably is something, which better should not be recommended to others. I'd like to hear if somebody has some better idea.)

((Text ends here, the rest is for your entertainment))

And here is a bed time story, inspired by this:

Some crops farmers went on rampage. Their crops dried out! So they investigated why there was not enough water in the irrigation ditch. In the nearer distcance they immediately spotted their culprit. The dam! The damned dam held up all the water!

From this moment on it was clear what to do. "Blow up the dam!" they yelled and started to collect their dynamite. Then they all headed straight for the dam.

The little son of one of the farmers asked his father about what was going on. He told his son: "There's not enough water in the ditch, so we blow up the dam!" Then he immediately left to follow the pack.

"But", the little one tried to shout after his father, "But there is a valve! Just open the valve!" Sadly, his voice was too gentle, and his legs were too short, so this message did not reach anybody.

The boy sat down and cried. Half an hour later he heared the distant "Boom" which destroyed his favorite plaground at the dam, where the valve was located, too.

What happened next?

The Flood swept away all the precious crops. The bank took away the boy's father's farm. His father was unable to pay for a good school. So the boy joined the army to get a higher education. There he learned everything about the phyics of explosives and now tries to invent a blast resitant dam.

What has this story to do with this here?

  • The crops farmers are the other answers.
  • The little boy is this answer here.
  • The dam is the Ubuntu failsafe sleeping.
  • The valve is the proper interface setting.
  • The water is the boot process.
  • The crops is your Ubuntu OS.
  • And the filled ditch is, how the boot process should look like.

The setting of the interface, which lives in /etc/network/interfaces, is blown up with the sleep in failsafe removed, and even if somebody sees the closed valve (auto), nobody spottet that it could be openend as well!

4
  • 2
    This is the correct answer. I hope the original asker chooses this as the correct answer and marks the issue as solved. May 15, 2016 at 16:52
  • 2
    Thanks for sharing @Tino. The story is nice but in my opinion it clutters the answer too much and at least it should not be placed before the last useful technical notes
    – ndemou
    Aug 18, 2016 at 10:16
  • @ndemou Thanks for noting, edited accordingly. I tried to use a spoiler for the story, but it did not come out as I liked it, so I left it in as is for now.
    – Tino
    Aug 18, 2016 at 11:17
  • Best quality answer and the irony of the story is priceless. Aug 16, 2018 at 10:42
13

Add a # in the /etc/init/failsafe.conf file in front of all lines containing sleep <n>. Doing so would help to boot fast.

This would lead to a faster boot, and it would not fix any issues with the /etc/network/interfaces file. Fixing issues with the /etc/network/interfaces file is not the purpose of /etc/init/failsafe.conf file.

There are situations where you want the network interface to not work (i.e. have a laptop that only has the eth0 interface (wired connection) plugged in some of the time). I don't want to have to wait 2 extra minutes for my laptop to boot because I don't have the wired connection plugged in.

3
  • 5
    Could some of those lines (and the deliberate delays they produce) be important? If not, I recommend expanding this answer to explain why. Mar 25, 2013 at 11:43
  • 3
    I believe those delays are now exclusively in the ubuntu server configuration and they are there to reduce the number of people who complain about things not working correctly because some network daemon startup up before there were working interfaces (maybe dns) and so it's better to wait here than hurry through a boot up with no network connections.
    – kkron
    Sep 5, 2015 at 22:57
  • 2
    Good answer! The author of failsafe.conf left his email in there with comments on why he is waiting for two minutes unless there is a static address. I feel this man may be solely responsible for the instances of Ubuntu that boot 48x slower than Windows ;)
    – Brain2000
    Apr 14, 2016 at 5:24
2

I had a similar problem. By running ifconfig -a, I determined that the only network devices on my computer were p4p1 and lo. There was no eth0.

So I edited /etc/network/interfaces, replacing all instances of eth0 with p4p1. The file's contents are now:

auto lo
iface lo inet loopback

auto p4p1
iface p4p1 inet dhcp

After rebooting, the networking was working fine.

If it matters, I was using Ubuntu 12.04.5 Server edition.

2
  • Perhaps replace auto p4p1 with allow-hotplug p4p1 and your computer also boots quickly if Ethernet is down. However this depends on your setup. For example if it is a workstation or server with network shares (NFS or Samba) you definitively want to wait for the Network to be available before continuing, so allow-hotplug would be the wrong choice.
    – Tino
    Apr 17, 2016 at 9:59
  • Thank you!! With ifconfig -a I discovered that the interfaces were really eth4 and eth5. Aug 22, 2016 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .