24

I have recently installed ubuntu server 16.04 LTS.a message is coming at the starting time " a start job is running for the raise network " & it takes too much time under offline network. but, when it comes to online makes no problem. how to make faster the startup process without this annoying message if I want to come offline ? and also there is a bridge connection named "virbr0" but not the simple ethernet network, why is this happening ?

need help .

4 Answers4

19
auto eno1
iface eno1 inet dhcp

to

allow-hotplug eno1
iface eno1 inet dhcp

For more information https://manpages.debian.org/stretch/ifupdown/interfaces.5.en.html

  • 4
    This fixed slow startup on Ubuntu 18.04 after installing KVM for Android Studio. My Android Emulators (VMs) + I still have internet connection so I guess nothing broke. Thanks alot! – hb0 Dec 12 '19 at 16:09
  • 1
    Thanks, this solved our problem for laptops managed by puppet/debnet. This commit is available for other folks in the same boat: https://github.com/rtib/tib-debnet/pull/18/commits/c1944642c8860085f87b92ed2494612f346fa6c5 – Bill McGonigle May 11 '22 at 17:21
  • This shoul be the accepted answer. Works like a charm – borekon Mar 07 '23 at 07:58
  • This should be accepted as the correct answer! Man, for the newbies ones, you should also add that the file you've changed is /etc/network/interfaces – FtheBuilder Jun 11 '23 at 05:58
18

I seem to get the same issue and I also have a bridged network interface, probably from my VirtualBox setup, enp0s31f6:avahi.

My system is ubuntu 16.04 LTS server variant, installed on a laptop, so primary use is as a workstation. As pr the comments this still applies for ubuntu 20.04 LTS.

The issue is there if the bridged interface is there, not if it's not present, say if VirtualBox has not been started inbetween reboots.

The reason is as in the other answer that this interface lacks init info.

My sollution was to reduce the timeout, and to do so without messing with the base installed networking.services systemd file. This will persist during updates in any package.

sudo mkdir -p /etc/systemd/system/networking.service.d/
sudo bash -c 'echo -e "[Service]\nTimeoutStartSec=20sec" > /etc/systemd/system/networking.service.d/timeout.conf'
sudo systemctl daemon-reload
sastorsl
  • 463
  • 1
    Works on Ubuntu 18.04 LTS (desktop) as well, thanks! I appreciate the additive nature of this solution. – Raphael Jul 23 '18 at 07:43
  • This solved the long waiting time for me as well, however the root cause is not fixed which is that the bridged network interface suddenly stoped connecting to the internet. So the ubunut box within vb now has no internet connection. – merlin Feb 12 '19 at 18:33
  • I'm using a WLAN USB adapter and have the same issue. This fix makes the boot faster but then the wireless adapter does not work anymore. Resetting settings and plugging it out and in again helped. Damn, I was happy to find a quick solution. – hb0 Dec 05 '19 at 08:48
  • 2
    Works also for Ubuntu 20.04 LTS. My boot time was more than 5 min (crazy) and not is around 2.5 min. The only solution would be to make a clean install, rather than and upgrade. – vasiauvi Jun 21 '20 at 16:39
4

Follow these steps:

  • Open Terminal (Ctrl + Alt + T)
  • Open /etc/network/interfaces file with gedit or nano:

    sudo nano /etc/network/interfaces
    
  • Set below text for any interfaces in this file:

    auto lo
    iface lo inet loopback  
    auto eth0
    iface eth0 inet dhcp  
    auto wlan0
    iface wlan0 inet dhcp
    
  • Save the file and reboot

  • 1
    why 2 times the eth0 declaration??? before wlan0 and after wlan0? – Philippe Gachoud Jul 15 '18 at 15:37
  • 1
    I have corrected it. thanks a lot @PhilippeGachoud – Ghasem Pahlavan Jul 15 '18 at 20:34
  • 1
    Could you add a little explanation about what exactly this does? – StackzOfZtuff Jun 15 '20 at 07:13
  • @StackzOfZtuff I don't know if this is it's proper use, but I use it to force wireless connections on my network, because I have a weird wireless card. You can use it to define the network name, password and also manually configure DHCP – pigeonburger Dec 22 '20 at 06:06
  • Folk who are more security conscious might prefer sudoedit rather than sudo $YOUR_EDITOR so that the editor itself does not run as root. (If you don't like the system-wide default editor, you can export SUDO_EDITOR=/path/to/your_favourite_editor somewhere in your shell startup files; or create an shell function like sudonano() { SUDO_EDITOR=$(command -v nano) sudoedit "$@" ; }.) – Martin Jan 29 '24 at 07:24
  • 1
    For the record, this advice is directly contrary to that indicated elsewhere, which is that auto should be replaced with allow-hotplug instead. This makes a difference if your NIC is not connected at boot-up. – Martin Jan 29 '24 at 07:27
2
  1. Open Terminal (Ctrl + Alt + T)
  2. Open /etc/network/interfaces file with gedit or nano:

    sudo nano /etc/network/interfaces
    
  3. Set below text for any interfaces in this file:

    auto lo
    iface lo inet loopback
    
  4. Remove any other entries.

  5. Save the file and reboot

It solved for me.