13

I am receiving the message "Start job is running for wait for netowrk to be configured" during bootup. Computer hangs for 2 minutes until whatever is going on times out. Network connection appears to be there since there appears to be a successful synchronization to time ntp.ubuntu.com just prior to the hang.

This is within VirtualBox, after setting Adapter 1 to NAT, Adapter 2 to Host-Only Adapter, and setting /etc/netplan/50-cloud-init.yaml as follows:

network:
    ethernets:
        enp0s3:
            addresses: []
            dhcp4: true
        enp0s8:
            dhcp4: true
    version: 2

(I'm new to netplan; admittedly I'm poking in the dark here).

Reviewing syslog after bootup, here is what I see:

Nov  6 22:55:47 magnolia systemd-networkd[539]: enp0s3: Gained IPv6LL
Nov  6 22:55:47 magnolia systemd-networkd[539]: enp0s3: Configured
Nov  6 22:55:47 magnolia systemd-networkd-wait-online[546]: ignoring: lo
Nov  6 22:55:47 magnolia systemd-networkd-wait-online[546]: managing: enp0s3
Nov  6 22:55:47 magnolia systemd-timesyncd[423]: Network configuration changed, trying to establish connection.
Nov  6 22:55:47 magnolia systemd-networkd[539]: enp0s8: Gained IPv6LL
Nov  6 22:55:47 magnolia systemd-timesyncd[423]: Synchronized to time server 91.189.89.199:123 (ntp.ubuntu.com).
Nov  6 22:55:47 magnolia systemd-networkd-wait-online[546]: Event loop failed: Connection timed out
Nov  6 22:55:47 magnolia systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Nov  6 22:55:47 magnolia systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Nov  6 22:55:47 magnolia systemd[1]: Failed to start Wait for Network to be Configured.
Nov  6 22:55:47 magnolia systemd[1]: Starting Initial cloud-init job (metadata service crawler)...
Nov  6 22:55:47 magnolia cloud-init[587]: Cloud-init v. 18.4-0ubuntu1~18.04.1 running 'init' at Tue, 06 Nov 2018 22:55:46 +0000. Up 128.51 seconds.
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: | Device |  Up  |           Address           |      Mask     | Scope  |     Hw-Address    |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s3 | True |          10.0.2.15          | 255.255.255.0 | global | 08:00:27:c9:60:26 |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s3 | True | fe80::a00:27ff:fec9:6026/64 |       .       |  link  | 08:00:27:c9:60:26 |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s8 | True |        192.168.56.105       | 255.255.255.0 | global | 08:00:27:41:62:12 |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s8 | True | fe80::a00:27ff:fe41:6212/64 |       .       |  link  | 08:00:27:41:62:12 |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: |   lo   | True |          127.0.0.1          |   255.0.0.0   |  host  |         .         |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: |   lo   | True |           ::1/128           |       .       |  host  |         .         |
Nov  6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+

I find it curious the timestamp doesn't reflect the 2 minute wait, but perhaps that's another question.

I found this other answer for Ubuntu 17, appears to be related: A start job is running for wait for network to be configured. Ubuntu server 17.10

and tried disabling systemd-networkd-wait-online.service as indicated but that does not appear to work (still get the 2 minute wait).

Any ideas what's going on here, and how to fix it?

yahermann
  • 233
  • 1
  • 2
  • 6

2 Answers2

24

Notes:

  • Undo your previous fixes. Return them to the original state.

  • You may be having a problem obtaining IPv4 addresses.

  • In setting up your VM, you set "Adapter 1 to NAT, Adapter 2 to Host-Only", and I'm not sure that's 100% correct... However, if you're getting the correct IP addresses then it's probably OK.


Try this in your /etc/netplan/50-cloud-init.yaml...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true
      optional: true
    enp0s8:
      dhcp4: true
      optional: true

In the terminal, run the following...

  • sudo netplan generate

  • sudo netplan apply

  • reboot

heynnema
  • 70,711
  • 1
    Thank you for your answer! I decided not to change anything the VM setup because everything does seem to work perfectly after the 2-minute wait. Then, changing the 50-cloud-init.yaml in the manner you suggested eliminates the 2-minute wait AND everything seems to work perfectly. So thanks again! – yahermann Nov 15 '18 at 00:09
  • @yahermann Same issue. Your answer worked for me perfectly. – David Simic Dec 06 '18 at 06:54
  • had the same issue, and this worked great for me! – SlimsGhost May 28 '19 at 14:05
  • 1
    Just setting optional: true and reboot worked for me! Thank you @heynnema, @yahermann; your inputs saved me at least 500 min per year! (2 min of wait time every week day!) – Snidhi Sofpro Aug 21 '19 at 07:03
0

I had this issue when cloning a VM. The clone had the same MAC address as the original. Because I was running the clone at the same time as the original, there was a MAC address conflict at layer 2. I resolved the issue by going into the VM settings, network, advanced (virtual box) and changing the last character of the VM mac address to make it unique. For those not familiar with MAC addresses, the valid characters for a MAC are 0-9 a,b,c,d,e,f.