0

I have a Fedora 26 VM. When I log in to GNOME, it shows a connection to the network. GNOME shows the network profile for the device as "Connect automatically" and "Shared with all users" (in the Identity section). And I can SSH in to the VM... But sometimes I find I can't SSH in. Until after I log in on gdm (GNOME) first.

This doesn't happen if I reboot the VM. So I think it's happening when I suspend the host with the VM still running (but not logged in?).

What is happening in the VM when I log into GNOME, that causes it to re-connect? Is the connection loss a bug that can be fixed in the software?

systemctl status shows both NetworkManager and network.service as being in their OS-provided default state:

● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; generated; vendor preset: disabled)

● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2017-09-17 17:43:48 BST; 1 day 15h ago

nmcli after login:

$ nmcli con
NAME                UUID                                  TYPE            DEVICE 
Wired connection 1  937653fb-890f-3b19-97b8-b98c8eafcdc5  802-3-ethernet  ens3   
virbr0              6e568806-d720-42ed-a555-0a1c50f1a36c  bridge          virbr0 
ens3                afba101e-6470-3699-b87b-932ab4efe634  802-3-ethernet  --

I can only find configuration files for the unused connection "ens3", which is for a previous device with a different MAC address. The VM is an upgraded clone of a Fedora 25 VM; presumably the MAC address was changed when cloned.

$ cd /etc/NetworkManager/system-connections/ && ls
$ cd /etc/sysconfig/network-scripts/ && ls ifcfg-*
ifcfg-ens3
ifcfg-lo
$ cat ifcfg-ens3
HWADDR=52:54:00:A7:3B:22
TYPE=Ethernet
BOOTPROTO=dhcp
...
NAME=ens3
UUID=afba101e-6470-3699-b87b-932ab4efe634
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
$ ip link show dev ens3
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:59:9b:47 brd ff:ff:ff:ff:ff:ff
0

The system log shows that it is not logging in to GNOME that fixes the problem, but just waiting 2 minutes :).

$ journalctl -b -u NetworkManager
...
Sep 18 23:04:35 fedora26-vm dhclient[15040]: bound to 192.168.122.157 -- renewal in 1450 seconds.
Sep 19 08:45:51 fedora26-vm NetworkManager[656]: <info>  [1505807151.7261] dhcp4 (ens3): state changed bound -> expire
Sep 19 08:45:51 fedora26-vm NetworkManager[656]: <info>  [1505807151.7698] dhcp4 (ens3): canceled DHCP transaction, DHCP client pid 15040
Sep 19 08:45:51 fedora26-vm NetworkManager[656]: <info>  [1505807151.7699] dhcp4 (ens3): state changed expire -> done
Sep 19 08:45:51 fedora26-vm NetworkManager[656]: <info>  [1505807151.7701] device (ens3): scheduling DHCPv4 restart in 120 seconds, 3 tries left (reason: lease expired)
Sep 19 08:47:51 fedora26-vm NetworkManager[656]: <info>  [1505807271.7908] dhcp4 (ens3): activation: beginning transaction (timeout in 45 seconds)
Sep 19 08:47:51 fedora26-vm NetworkManager[656]: <info>  [1505807271.7972] dhcp4 (ens3): dhclient started with pid 15271
Sep 19 08:47:51 fedora26-vm dhclient[15271]: DHCPDISCOVER on ens3 to 255.255.255.255 port 67 interval 5 (xid=0x37e5e131)
Sep 19 08:47:51 fedora26-vm dhclient[15271]: DHCPREQUEST on ens3 to 255.255.255.255 port 67 (xid=0x37e5e131)
Sep 19 08:47:51 fedora26-vm dhclient[15271]: DHCPOFFER from 192.168.122.1
Sep 19 08:47:51 fedora26-vm dhclient[15271]: DHCPACK from 192.168.122.1 (xid=0x37e5e131)
...

(08:45:51 is exactly when the host logs show the system being woken from suspend).

The DHCP lease is correctly being recognized as expired. But the system doesn't seem to notice that it had not tried to renew the lease beforehand; it assumes it had already just tried and failed, and so it sets a timeout before restarting again. Looks like a bug to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.