37

I get the following pieces of information at the startup, takes about 3 to 5 minutes, while normally about 1 minute:

Waiting network configuration
Booting system without full network configuration

I found after googling that I should change /etc/networks/interface. I commented out everything there but the problem remains:

# auto lo
# iface lo inet loopback

# auto eth0
# iface eth0 inet dhcp
# address 192.168.0.2
# netmask 255.255.255.0
# gateway 192.168.0.1
# broadcast 192.168.0.255

How can you make the startup of Ubuntu 11.10 faster?

Jorge Castro
  • 71,754
  • 2
    @jrg It is not a code problem, it a desing problem. Can I file a bug about such a problem? – Léo Léopold Hertz 준영 Nov 04 '11 at 22:53
  • 1
    Yes, you can. Just make a note that it is a design bug. :) – jrg Nov 05 '11 at 00:33
  • 5
    I do not understand this behavior. I do not want to change my interfaces file every time I go home. There are situations where I simply have no network OR I use wicd AFTER logging in. For me as a laptop owner that means waiting 2 senceless minutes. Twice every day. Besides: I configured all interfaces to be static. No way. –  Nov 04 '11 at 22:12
  • @jrg What should be the status of the bug? - I selected xorg as the package, since needed to select something. I put the status to invalid to it, since it is not really about it. - It is about the design. Can people understand now that the status of the bug is not declined, but only for the package xorg? – Léo Léopold Hertz 준영 Nov 05 '11 at 14:04
  • @Masi Hm, not sure. – jrg Nov 05 '11 at 14:21
  • 2
    Use allow-hotplug instead of auto in the /etc/network/interfaces file, e.g., allow-hotplug enp0s25 then iface enp0s25 inet dhcp. This tells the server to not wait for the interface to light up with a dhcp answer. – Zachary Scott May 11 '17 at 14:37
  • @Dr.Zim I made your answer proposal a wiki answer here https://askubuntu.com/a/914479/25388 Please, feel free to add an example output, ..., statistics, about why this is a better proposal than auto. – Léo Léopold Hertz 준영 May 12 '17 at 13:10

7 Answers7

38

First off, this is a new behavior, documented in the 11.10 release notes, that I actually developed together with Scott Moser as an effort to make server boot more reliable.

Commenting out lo will mean you have no local network capability, which will break some programs when they try to use the network. It will also cause your system to never boot because it is so critical. So leave these two lines:

auto lo
iface lo inet loopback

The bits about eth0 meant that your machine was configured to wait for a dynamic address to be assigned to it before the network is considered UP. In pre-upstart versions of Ubuntu (8.10 and earlier), the system would have waited up to 60 seconds for this before continuing the boot. When upstart was added, this condition wasn't waited for anymore, because network interfaces that were not always expected to be plugged in are better managed by something like network-manager.

So, if you have a server, you probably want to wait for a dynamic address, otherwise the system will boot without all of its networks available (which it does if it takes more than 2 minutes to get an address). If you have a laptop that you don't always expect to be plugged in to eth0, then configure eth0 in network manager, and remove only those lines from /etc/network/interfaces, which should get rid of your boot delay.

Keep in mind, there's a known bug with VMware and dbus that also causes this message.

SpamapS
  • 19,820
  • I have USB Huawei E367 mobile ADSL modem. Do I need eth0 for it to work? - For some reason the given modem stopped know working. I have only auto lo; iface lo inet loopback in /etc/network/interfaces. – Léo Léopold Hertz 준영 Oct 18 '11 at 10:03
  • 1
    Masi, sounds like you need to ask a different question. – SpamapS Oct 19 '11 at 00:24
  • I suggest that you run NetworkManager, Click on Edit Connections, click on the DSL tab, then on Add and explore all of its tabs. – waltinator Oct 20 '11 at 07:09
  • Done it. It seems that my internet operator just blocked my connection because of overuse of my light ADSL connection. – Léo Léopold Hertz 준영 Oct 20 '11 at 18:36
  • Ok, my internet connection was not blocked. After some Ubuntu updates, my E367 stopped work. It is very probably a known bug in Ubuntu. – Léo Léopold Hertz 준영 Oct 26 '11 at 19:30
  • 3
    Sorry, I am a newbie and I still don't understand why the system must wait around 2-4 extra minutes for IP. And the main question is "do I need this one. if I have a laptop and I always use wired and wireless network connections?" – itun Nov 02 '11 at 10:14
  • @itun Very good point. The developers are trying to save their time by making Desktop Ubuntu and Ubuntu Server more similar or same. However, I do not see that it is a right thing. I see that is a bug in the philosophy of developing Ubuntu. – Léo Léopold Hertz 준영 Nov 04 '11 at 22:47
  • 2
    @SpamapS and Scott Moser Please, change the thing back it was. You are hurting Desktop users. I understand your point that you save time in programming things, but please consider if 100 million users lose every day 2 minutes because of such a change. It is a huge cost! Please, branch Ubuntu Server completely different from Ubuntu Desktop. – Léo Léopold Hertz 준영 Nov 04 '11 at 22:50
  • I have removed the two lines (mentioned above), but it did not help me to turn off network configuration in the Ubuntu start. – itun Nov 05 '11 at 22:18
  • 5
    upvoting this for awareness BUT as a normal Desktop user I am VERY UNHAPPY that there is no fast boot option for this. Definitely perceived as a degradation from 10.04 to 12.04 upgrade. This problem is compounded by the fact that network manager is unable to directly control settings such as duplex and autoneg, resulting in the need to achieve that via /etc/network/interfaces – prusswan Feb 06 '12 at 04:17
  • prusswan, I have been pondering adding a 'nowait' option for power users to be able to not wait on certain interfaces... I'll give it another look before feature freeze. – SpamapS Feb 06 '12 at 07:28
  • @SpamapS Where does it appear in the release notes? I'm looking https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes and can't find a specific reference to it. – Lorin Hochstein Feb 10 '12 at 21:20
  • Good catch Lorin, I never actually read the final notes until now.. it appears that note did not make it in! I will investigate and see if they can be amended. – SpamapS Feb 12 '12 at 20:57
  • SpamapS, your solution did the trick for me. As already states by others: this is an issue I had in virtualbox. Try to change to NAT instead of bridged, that helped with another vdi for me. Hope I helped someone out. –  Apr 13 '12 at 18:14
  • 2
    @SpamapS: While I'm glad you've pondered adding a no wait option, what really needs to be pondered is why Canonical so consistently fails at QA (user for the last 6 years, and I encounter showstopper regressions every release that should have prevented every release). That aside, the server and minimal CDs are widely used for desktop installation because the graphical installer often has issues and/or it's easier getting the minimal CD running on faulty media. It is definitely not safe to assume that because a user is using the alternate or minimal CD they must be installing a server. – Joseph Garvin Sep 22 '12 at 06:21
  • Joseph I'd suggest you post evidence of these regressions to the ubuntu-devel-discuss mailing list so that they can be addressed (here is not the place). On the other point, while it may have been a bit painful to add 2 minutes to the boot for users who were using fairly unconventional configurations on desktop, it has been a HUGE win on the server. We do need to address the need to have nowait interfaces, but it remains a corner case, and many users have simply moved to using network-manager where possible. – SpamapS Sep 24 '12 at 19:10
  • @SpamapS Keeping only local loop doesn't work for me. I am using 12.04 on Laptop and ethernet is not always connected. Network Manager doesn't start after the boot !! I have to manually do it every time.. I just don't want that "Network Configuration check". What should I do ?? – mythicalcoder Jun 27 '13 at 07:22
  • @cognoz same for me – did you find a solution? – Andy Nov 21 '14 at 18:11
  • I have the loopback lines yet I still get this message... – rbaleksandar Aug 15 '15 at 09:21
8

If you moved your OS from one machine to another it might be a good guess that udev created a configuration containing the mac address of your old network device which is different from the mac address of the network device from your new system.

Try removing the following file then reboot your system and see if this solves the problem:

/etc/udev/rules.d/70-persistent-net.rules
Eliah Kagan
  • 117,780
  • dachange thanks for getting me on the right track to solve a different issue ! i was getting a reset timeout on my wlan0 rlt8185 device when executing ip link set wlan0 up. Looked in the 70-persistent-net.rules file and commented out the line that added my wireless device, rebooted and now it's working! –  Jun 18 '12 at 19:56
6

You're mixing 2 incompatible ways of assigning an address to a network interface.

iface eth0 inet dhcp

says "send out a DHCPDISCOVER packet to the physical local network, wait for a DHCPOFFER packet from a physically local DHCP server, and get the IP address from it (see http://www.rfc-editor.org/rfc/rfc1531.txt), while the rest of the lines assign values to the interface "manually". It's important that one gets the IP address assignment method right. If there is a DHCP server on your local network, you should use it. To do so, delete the "address", "netmask", "gateway", and "broadcast" lines.

If you're not connected to an "administered" local area network (and don't have a DHCP server), and want to assign the IP address parameters manually, change the first line to:

iface eth0 inet static

and keep the "address", "netmask", "gateway", and "broadcast" lines. See http://www.rfc-editor.org/rfc/rfc5735.txt for details about which IP addresses are available for use. The parameters you have look OK to me.

Read

man 5 interfaces

simply commenting everything out is not the best path to happiness.

waltinator
  • 36,399
  • Thank you for your answer! - Why does my Ubuntu work with empty /etc/network/interfaces? - How can you see that it is not working normally or efficiently? – Léo Léopold Hertz 준영 Sep 28 '11 at 22:00
  • So the last line says: send out a static package to the physical local network, wait for a static package from a physical local network, and get the IP address from it. – Léo Léopold Hertz 준영 Sep 28 '11 at 22:02
  • I have know [code]iface eth0 inet static address 192.168.0.2 netmask 255.255.255.0 gateway 192.168.0.1 broadcast 192.168.0.255[/code], in my /etc/network/interfaces and the problem still persists: loading a lot. – Léo Léopold Hertz 준영 Sep 28 '11 at 22:09
  • No. The line with "static" says "Get the IP address from the following lines" no network packets are sent. – waltinator Sep 28 '11 at 22:23
  • When you change /etc/network/interfaces do you do a sudo service networking restart to take the networking down and up cleanly? What does "loading a lot" mean? If you're waiting for the arrival of a nonexistent, never-going-to-arrive DHCPOFFER packet multiple times (and remember that the interface has to be UP to send/receive packets) that will slow you down. Can you describe your network? What's on the other end of the wire coming out of your NIC? What Ubuntu version are you using? – waltinator Sep 28 '11 at 22:45
  • It means that I get the given loading messages at the very top of my question before the login screen. – Léo Léopold Hertz 준영 Sep 30 '11 at 10:27
  • Ubuntu 11.10. I have only X60 with one E367 -modem, mobile broadband. No other external devices. – Léo Léopold Hertz 준영 Sep 30 '11 at 10:28
  • 1
    I think I understand. Because your mobile broadband isn't configured when the boot sequence does its ifconfig -a during startup, you get the timeout. – waltinator Oct 02 '11 at 18:23
  • I think I understand. Because your mobile broadband isn't configured when the boot sequence does its ifconfig -a during startup, you get the timeout. Remove the auto eth0, and I suggest that you change to the DHCP method of address assignment, and only have iface eth0 inet dhcp. Then, login and look for the networking icon in the top row, left of speaker icon on my Ubuntu 11.10. YMMV – waltinator Oct 02 '11 at 18:33
  • i use

    auto lo iface lo inet loopback

    mapping hotplug script grep map eth1

    iface eth1 inet dhcp

    auto eth0 iface eth0 inet static address 10.152.187.1 netmask 255.255.255.0

    auto wlan0 iface wlan0 inet static address 192.168.1.1 netmask 255.255.255.0 up /sbin/iwconfig wlan0 mode TTTTTT && /sbin/iwconfig wlan0 enc restricted && /sbin/iwconfig wlan0 key [Y] XXXXXXXX && /sbin/iwconfig wlan0 essid SSSSSSSS

    auto eth1

    how can i get rid of the boot issue?

    – Matthew Wilson Jan 07 '12 at 00:16
5

Seems like for me, the best solution for this problem was found at this linux site

Basically, still calling /etc/init/failsafe.conf , but commenting out the two sleep calls that caused the delay. I don't really see why they were added, since my network is configured fine without the need for a delay.

mcchots
  • 318
Ted
  • 51
  • 1
  • 2
3

I use

eth0 inet dhcp

I don't see the point of waiting when there is no link (the cable is missing) There is no way dhcp can get the address if there is no media. This is a bug

Jorge Castro
  • 71,754
wah
  • 31
2

I recently just had this same problem. I tried to go in and comment out the sleep time in /etc/init/failsafe.conf file and ended up with the system just continuously trying to boot. I fixed this error by booting into safe mode and droping into a root shell and doing the following so that I had rw privleges:

mount -o remount,rw / 

I then issued the following command which brought up the file so that I could edit it back to it's orginal state:

sudo nano /etc/init/failsafe.conf 

Save and exit, then reboot the system.

Fern Moss
  • 8,785
clrn0979
  • 53
  • 5
  • Can you, please, say what you edited in the file failsafe.conf. Did you comment out the sleep calls? I tried that some years ago unsuccessfully. – Léo Léopold Hertz 준영 Jul 08 '14 at 20:53
  • 2
    Absolutely. After you are in the failsafe.conf txt, you just look for the sleep calls. I put mine back to 5, 40, and 59 respectively. I however was unable to succesfully comment out the sleep calls as it caused the system to go into continuous boot. – clrn0979 Jul 19 '14 at 07:35
2

Use allow-hotplug instead of auto in the /etc/network/interfaces file, e.g., allow-hotplug enp0s25 then iface enp0s25 inet dhcp. This tells the server to not wait for the interface to light up with a dhcp answer. - - Dr. Zim's comment.