network-manager does not manage ethernet and bluetooth interfaces when Ubuntu 16.10 is installed using chroot/netboot method

Bug #1638842 reported by Raphaël Jakse on 2016-11-03
66
This bug affects 13 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Undecided
Unassigned

Bug Description

Hello,

I installed Ubuntu 16.10 using a chroot. I use network-manager to manage connections. My system is up-to-date (so I use network-manager 1.2.4-0ubuntu1).

Wifi works perfectly but I cannot connect to wired networks and using my phone's Bluetooth connection. Corresponding devices are said to be unmanaged by network-manager. nmcli dev outputs:

DEVICE TYPE STATE CONNECTION
enp1s0 ethernet unmanaged --
wlp2s0 wifi disconnected --
6C:9B:02:2C:EE:2C bt unmanaged --
hfp/org/bluez/hci0/dev_6C_9B_02_2C_EE_2C gsm unmanaged --
lo loopback unmanaged --

The following command has no effect:
sudo nmcli dev set enp1s0 managed yes

I can connect to a wired connection by doing:
ifconfig enp1s0 up
dhclient enp1s0

There is nothing in the file /etc/network/interfaces.

Everything works perfectly if I downgrade network-manager to this version: network-manager_1.2.2-0ubuntu0.16.04.3_amd64.deb (http://packages.ubuntu.com/xenial-updates/amd64/network-manager/download). I had to install libreadline6 and downgrade nplan to meet dependencies.

I don't know what to join to this bug report so please ask in case anything is needed.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
林博仁 (buo-ren-lin) on 2016-11-03
summary: - network-manager does not manage ethernet and bluetooth interfaces
+ network-manager does not manage ethernet and bluetooth interfaces when
+ Ubuntu 16.10 is installed using chroot/netboot method
林博仁 (buo-ren-lin) wrote :

Hi, I believe I have the same issue, however there's differences that you installed Ubuntu 16.10 using chroot, while I installed Ubuntu 16.10 using netboot(and then tasksel ubuntu-desktop), here are the investigation results:

## Possible Cause ##
The problem seems to be lies on the new override config introduced in 16.10:

```
  * debian/10-globally-managed-devices.conf: ship a default config to
    explicitly unmanage anything that is not wifi or wwan: we definitely want
    NM to manage wifi and mobile data; and probably don't want it to touch
    wired in many cases.
```

which is installed at /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf , with the following content:

```
[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan
```

that unmanages all network interfaces except wifi and wwan, thus bluetooth interface in your case and ethernet case in my case are all unmanaged by default.

According to the future changelog by Martin Pitt:

```
  * network-manager.postinst: Don't create
    /etc/NetworkManager/conf.d/10-globally-managed-devices.conf override on
    new installations. We don't want NM to manage non-wifi/wwan on
    servers/cloud instances, and for desktops live-build now installs a
    netplan policy snippet to let NM handle all devices.
```

This is designed to not let NM manage those interfaces except in a desktop edition(possibly because servers normally uses the ifupdown mechanism to manage networking), what I'm confused is:

* Why there's the need to do so when ifupdown NM plugin already provides the ability to unmanages the network interfaces that have settings in /etc/network/interfaces?
* Why the config still working after user installs *ubuntu-desktop, rendering those network-interfaces unmanaged even when it is clearly not for server/cloud usage?

## Workaround ##
Remove /etc/NetworkManager/conf.d/10-globally-managed-devices.conf, it works(TM)

林博仁 (buo-ren-lin) wrote :

Subscribing Martin Pitt as they wrote the second changelog, no offense.

林博仁 (buo-ren-lin) wrote :

Update Workaround in #2, in fact you need to remove /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf instead.

I just upgraded network-manager to test your workaround but I cannot
reproduce this bug anymore. I tried to restart networking and the
network-manager services. I also tried to purge network-manager and
reinstall it again. I didn't try to reboot.

The bug might affect new installations only.
Maybe network-manager remembers which devices it has already managed and
keeps managing them? Or the previous version of network-manager creates
configuration files that makes the new version work correctly?

Still, cat
/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
effectively gives me:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan

I don't know if this file was present when I was using the previous
version of network-manager. The new version of network-manager works
correctly with this file so it seems there is something else involved.

Le 03/11/2016 à 17:05, 林博仁 a écrit :
> Update Workaround in #2, in fact you need to remove
> /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf instead.
>

林博仁 (buo-ren-lin) wrote :

Update Workaround in #2 (again), the proper way to deal with it is to create a blank file with the same name under /etc/NetworkManager/conf.d , in command-line:

```
# touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
```

Martin Pitt (pitti) wrote :

Comment #6 is the correct solution. On desktop images we want NM to manage everything, thus the installer creates /etc/NetworkManager/conf.d/10-globally-managed-devices.conf. But on a server, container, or similar environment we do NOT want NM to suddenly take over existing connections from netplan, networkd, or ifupdown -- there it should be restricted to wifi and 3G.

Changed in network-manager (Ubuntu):
status: Confirmed → Won't Fix
Julian Taylor (jtaylor) wrote :

I just upgraded from 16.04 desktop to 16.10 and the file /etc/NetworkManager/conf.d/10-globally-managed-devices.conf was not created so my wired network did not work.
Creating the file fixed this issue.
Is the file supposed to be created on desktop upgrades?

Felix Bors (felix-bors) wrote :

Same as post #8; this fixed it for me too...
thanks

sptorrent (spdyn1) wrote :

Comment #6 fixes it fine for me.
Thanks

Gareth Western (gareth-b) wrote :

Same problem after an upgrade from 16.04 to 16.10 via "do-release-upgrade". #6 fixes the issue.

This problem also occurs when installing from the alternative CD install. Comment #4 worked for me.

Diego (gran-diego) wrote :

Same problem here, as stated in https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1658921

Five computers (2 laptops and 3 desktops), upgraded from 16.04. No chroot. Comment #6 did the trick.

I can't believe this is tagged as "won't fix"

Spode (forums-g) wrote :

#4 worked for me, but refusing to fix this is ridiculous. Not everyone is going to have alternative web access to search for the fix and there will be laptop owners who will not discover the network port is not working until they have a problem with their router configuration.

Please reconsider this status tag.

Andrei (andrei-doom) wrote :

I just upgraded 16.04 to 16.10 and had to search and find the solution on my fucking smartphone instead of the PC because somebody decided to change the way the network manager *manages* the network interfaces. Good job, you've just wasted tens of people's hours for nothing. I hope somebody's really proud of themselves. I swear to god, as soon as Android manages to take a big chunk out of the Linux desktop market share, Ubuntu goes right out of the SSD on my machine. I've just about had enough of this crap.

Chad Blackmon (chadb4184) wrote :

Comment #6 fixed it for me. Just needed to restart NetworkManager.service after creating the blank file.

brad (dragonsawareness) wrote :

This needs fixing

gerardo (geestbos) wrote :

Same problem after an upgrade from 16.04 to 16.10 via "do-release-upgrade". However in my case the issue occurred not for Ethernet or Bluetooth, but for Mobile Broadband (device ttyUSB2 of type gsm over interface ppp0). So, the changelog comment 'we definitely want NM to manage wifi and mobile data' is not really holding. Could it be the author erroneously supposed mobile data is only transferred over the wwan interface? In that case, the issue should indeed be fixed.

Miguel Rubio-Roy (mrubioroy) wrote :

Same problem after an upgrade from 16.04 to 16.10 via "do-release-upgrade". Ethernet and WiFi not managed.
Solved it creating blank file at /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
as per comment #6

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers