14

I've been trying to sort out two problems that I suspect are interrelated. Recently, our network got reconfigured and afterward, I encountered a very long boot time due to network configuration issues and, after booting, no longer able to access the samba file share from a Win10 client.

The boot time messages:

[  OK  ] Reached target Network (Pre).
Starting Network Service...
Starting Wait for Network to be Configured...
Starting Network Name Resolution.
[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Host and Network Name Lookups.
[**    ] A start job is running for Wait for Network to be Configured (XX / no limit)

It takes about two minutes for the last message to clear. I suspect it's maybe a DHCP or DNS-related issue. I've also noticed several of the "NXDOMAIN / potential DVE2018-0001 violation" errors interspersed in /var/log/syslog. At the moment, I really don't know where to go poking next to figure out what's causing this delay (or why the file server isn't visible to Win10 clients). Incidentally, Samba appears to be running and Webmin reports that the folder share is active...

EDIT 1:

Per the suggestion of @heynnema in the comments, the output of cat /etc/netplan/*.yaml:

# This is the network config written by 'subiquity'
network:
    ethernets:
        enp4s0:
            dhcp4: true
    version: 2

EDIT 2:

Samba-related output.

fstab contents:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/md2 during curtin installation
/dev/disk/by-id/md-uuid-4c695059:2f774b0b:9e5492d2:bcb62609 / ext4 defaults 0 0
/dev/disk/by-id/md-uuid-05f3f447:6002213f:2bb97c81:6416f121 none swap sw 0 0
# /boot was on /dev/md0 during curtin installation
/dev/disk/by-id/md-uuid-58dd9ab9:74b02d8a:10890b55:2212c9cb /boot ext4 defaults 0 
0
/swap.img   none    swap    sw  0   0

smb.conf Share Definitions:

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
;   valid users = %S

# Un-comment the following and create the netlogon directory for Domain 
Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin


[media_Public]
    create mode = 777
    path = /home/media/Public
    writeable = yes
    public = yes
    directory mode = 777
18
  • I think they are interrelated. The samba share cannot be reached (for some reason) any more, and the extended time is just a "timeout" waiting for the share to magically become available; which never happens. You should either fix the mounting of the samba share, or find the configuration to massively reduce the timeout duration, so it's not so disrupting if the share still plays hide-and-seek.
    – Levente
    Mar 5, 2021 at 20:58
  • I'm not very well-versed in filesystems, so the only way I can make something auto-mount is putting an entry in /etc/fstab. Did you do that too? If you remove the the corresponding entry, I think you could get back your normal startup time. Then you could go ahead and figure out what's wrong with the entry (by mounting manually, using verbose output). If you find the problem, you could put back the fixed mount entry to /etc/fstab. If not, you could present a more focused question on just the challenging mounting part. Possibly could find an already existing question/answer.
    – Levente
    Mar 5, 2021 at 21:03
  • Edit your question and show me cat /etc/netplan/*.yaml and I'll fix the 2 minute network wait time thingie. Show me sudo lshw -C network. Also show me cat /etc/fstab and the "Share Definitions" section from /etc/samba/smb.conf. Start comments to me with @heynnema or I'll miss them.
    – heynnema
    Mar 6, 2021 at 1:17
  • @heynnema - edit made. Output has been added to the post. Apologies for the late reply. It just occurred to me there's two network cards in this thing. One isn't being used yet, the other provides internet connectivity. The unused one is what's specified in the *.yaml output. Starting to think I know where the problem may lie...
    – Joel Graff
    Mar 14, 2021 at 17:01
  • You only gave me one of the four things that I need to help fix your problem.
    – heynnema
    Mar 14, 2021 at 19:28

4 Answers 4

19

Replace your current /etc/netplan/*.yaml file with this, and change enpxxx with the correct name of your second interface...

    network:
      version: 2
      renderer: networkd
      ethernets:
        enp4s0:
          dhcp4: true
          optional: true
        enpxxx:
          dhcp4: true
          optional: true

sudo netplan generate

sudo netplan apply

reboot

3
  • Fixed it perfectly! Thanks!
    – Joel Graff
    Mar 20, 2021 at 14:42
  • Thank you so much!
    – bkakilli
    Nov 22, 2022 at 5:51
  • This also worked for me. The sudo netplan ... commands seem to be optional since I forgot to issue them, but got the desired behavior. Feb 27, 2023 at 3:19
3

I was running into this same issue. Similar to heynnema's answer, but more specifically setting the interface to optional allowed the VM to start up (possibly without an IP from DHCP). For instance my netplan config now looks like:


network:
    version: 2
    renderer: networkd
    ethernets:
      ens3:
          dhcp4: true
          dhcp6: true
          optional: true

0

I had the same issue on a server that has been recently upgraded from Ubuntu 16 to 18 and then to Ubuntu 20. I found out that it was due to a conflict between netplan and /etc/network/interface that were enabled at the same time. I initially believed, due to my past experience with Ubuntu 20, that Netplan would be enabled by default, but this is apparently not the case anymore...

I fixed the problem by commenting out the content of /etc/network/interface (that was set for a DHCP address by default) and by adding the clause dhcp4: false in the netplan config file /etc/netplan/01-netcfg.yaml, as I was using a static IP (the long timeout being probably caused by a query to a non-existing DHCP, despite having set a static IP).

Good luck...

1
  • Ubuntu 16, 18 and 20 refer to Ubuntu core. Not what the OP asked about.
    – David
    Sep 22, 2022 at 8:03
0

I was installing Ubuntu 22.04 on a VM provisioned on an ESXi host. I had to supply at least 8 gigabytes of ram in order to proceed through the Host Network Lookup installation section. I can reliably reproduce this problem by toggling the ram down to 4gb.

TLDR

Increase the RAM on your VM to 8gb.

You must log in to answer this question.

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