Network-manager broken for desktop Ubuntu

Just wonder why would you like to switch the deb version of network-manager to snap on Desktop?

Don’t want to distract too much from the bug report, but I want to take advantage of the wake-on-wlan feature which the NetworkManager team fixed up in more recent versions to wake up this laptop remotely and use it as a headless server for development purposes.

Currently trying to clone it down and snapcraft it with classic confinement, altho haven’t much touched snap development. Git server is a bit flakey tho? It starts off fast then slows to a crawl - is there a mirror?

Those apparmor messages vaguely look like you’re trying to talk to network manager via a snap over D-Bus from an unconfined process - are you sure that you’re using nmcli from the snap?

Yes, I’m pretty sure I’m using the snap nmcli. Version matches up.

But I now realize that the snap is actually way older than the debian version? 1.2.2 for the snap versus 1.10.6 for the deb. So I’ll try to do the wake-on-wlan with the debian version.

I assumed the snap would be newer since I thought that was sort of the point of snaps - they’re isolated and easier to keep updated. But I guess this one isn’t.

You can try the 1.10 track instead:

snap install --channel=1.10/stable network-manager

This version contains the WoWLAN feature you need.

Please note that the WoWLAN feature was developed for a specific model of Dell IoT gateway, and as such has not been tested on any other hardware, so your mileage from this feature may vary. Also note that this support requires wpa-supplicant changes which have not yet landed in the archive. Although there is a wpa-supplicant snap with these changes, it’s about to be deprecated per this thread.

Regular applications and services can still be expected to interact with Network Manager over DBus.

I think the network manager snap should be unpublished from the main store and just published to the Dell gateway store. It is not ready for consumption on a desktop system.

I don’t think NetworkManager should be unpublished from the main store, it has in fact been tested on classic systems and non-Dell hardware, it’s just that this specific feature of WoWLAN that @awe mentioned was only tested on Dell hardware.

Additionally, what I mentioned about the D-Bus denials was the denials looked like an unconfined peer was trying to talk to NetworkManager and was being denied because the rules are written only for peers that are confined and using the appropriate plug. However, upon closer inspection the issue is almost certainly what @abeato explained and is just the wrong version of NetworkManager. I also see that the policy for D-Bus with NetworkManager does explicitly allow unconfined peers to talk to NetworkManager so that’s a supported use case.

Please discuss with @abeato then. When I first published the NM 1.10 snap, the install hook explicitly prevented it from being used on Desktop. @abeato made improvements to the snap and tested on Desktop, and as such convinced me to remove the check in the install hook.

it has in fact been tested on classic systems and non-Dell hardware

You noticed that the reviews on the store are 11 1-star and a few 2 and 3-star, right? And there’s a bunch of comments saying it doesn’t work. Granted, it’s not clear these people tried very hard or used the CLI tool. But it doesn’t seem to be working for most people in the wild? Have you tried?

@abeato when I tried the non-snap deb version 1.10.6, I didn’t see any setting the way I could see a setting for wake-on-lan (ethernet, described at https://wiki.archlinux.org/index.php/Wake-on-LAN#NetworkManager).

I tried the 1.10.6 snap version as suggested and it’s still broken. I didn’t see any dmesg errors in this case, but I couldn’t connect - either to the CLI or the internet. The dmesg logs you see here are from when I was trying the 1.2.2 version, as you can see from the difference in time logs - 13:10 versus 13.20 for active.

@jcrben,

  1. Check that all interfaces are connected with snap connections --all
  2. Try with sudo

Finally, note that this snap was designed and tested essentially for Ubuntu Core. There is actually little reason to use it on desktop in general. Said this, WoWLAN from suspend should work.

Regular applications and services can still be expected to interact with Network Manager over DBus.
I think the network manager snap should be unpublished from the main store and just published to the Dell gateway store. It is not ready for consumption on a desktop system.

This snap is not only used by Dell, but also in many Ubuntu Core systems. The store is not only for Desktop. We cannot, and we shouldn’t, unpublish it.

2 Likes

@abeato it didn’t work with sudo; I’m not sure what I would be be looking for in the snap connections --all; in any case, the internet doesn’t work regardless of nmcli.

Said this, WoWLAN from suspend should work.

Is there any reason it shouldn’t work with the default deb version? There’s no setting that I can set to “magic”. I’ve been using the regular ethernet wake-on-lan without problems, but that has a setting that I can set to magic. Is the only way to set the setting with the snap hook https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/reference/snap-configuration/wowlan? In which case it would require the snap, which doesn’t work for me. NOTE: I did run iw phy0 wowlan enable magic-packet; iw phy0 wowlan show confirms enabled

It only takes a few minutes to try out the snap - if someone could try it on desktop and it actually worked, I might be more inclined to experiment. I can’t even clone down the git repository to tweak it to classic.

A store which has apps which work only for one of two different platforms with no indication of which platform it works on doesn’t sound too useful - hopefully there’s a feature request logged to show the platform that an app works for. There’s clearly a bunch of frustrated users who have unsuccessfully tried to get the networkmanager snap working on desktop linux, regardless of whether they should. I’m more concerned by the publication of broken apps than I am about this specific feature.

Would it be best to log this as a bug in Launchpad so someone can investigate eventually? I know the backlog is long and there are higher-priority items.

@abeato it didn’t work with sudo; I’m not sure what I would be be looking for in the snap connections --all; in any case, the internet doesn’t work regardless of nmcli.

We’ve tried to explain that this snap was created, tested, and published to the Snap Store for use on Ubuntu Core. Yes, it can be made to work on a Desktop system, but it’s not for the faint of heart. Note this is specifically called out on the installation page for the snap:

The NetworkManager snap is currently available from the Ubuntu Store. It can be installed on any system that supports snaps but is only recommended on Ubuntu Core at the moment.

Is there any reason it shouldn’t work with the default deb version? There’s no setting that I can set to “magic”. I’ve been using the regular ethernet wake-on-lan without problems, but that has a setting that I can set to magic.

It doesn’t work with the default deb version in bionic because that version of NetworkManager was released before the WoWLAN code was written. It’s since been merged into upstream NetworkManager, but is only present in versions 1.14 or greater, which means you’d have to at minimum use the disco release of Ubuntu (ie. 19.04) which provides network-manager 1.16.0-0ubuntu2.

But even if you did that, it’s likely that it still won’t work as WoWLAN is highly dependent on the WiFi driver and physical hardware having been designed to support WoWLAN. Are you absolutely sure both fully support WoWLAN?

My suggestion to you would be to use WoLAN instead and just continue to use the deb from the archive, or update to a newer version of Ubuntu and try to get it WoWLAN working there first.

1 Like

Thank you, that’s quite detailed. When it’s not running off the flash drive the laptop runs NixOS so I’ll try that, but NixOS tends to be finicky on its own. Or I’ll work up another flash drive running some other distro. Most likely there is a hardware/firmware problem with my laptop, but I am willing to experiment.

As I mentioned in my last post, “I’m more concerned by the publication of broken apps than I am about this specific feature”. I appreciate that there’s something warning users on a webpage, but the actual store page itself (which mirrors https://snapcraft.io/network-manager) says nothing about Ubuntu Core and every review of it expresses frustration. I’d rather that my fellow Linux users do not have to experience this frustration, and I’d like to avoid accidentally installing Ubuntu Core apps on the store myself. Do you have any sense of where I should log this issue for eventual resolution? Or should I just post Launchpad bugs in various places that seem reasonable?

@jcrben :

$ sudo systemctl stop NetworkManager
$ snap install --channel=1.10 network-manager
network-manager (1.10/stable) 1.10.6-1-20190619+916e95e2 from Canonical✓ installed
$ systemctl status snap.network-manager.networkmanager.service 
● snap.network-manager.networkmanager.service - Service for snap application network-manager.networkmanager
   Loaded: loaded (/etc/systemd/system/snap.network-manager.networkmanager.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-07-30 10:31:08 CEST; 1min 37s ago
 Main PID: 14799 (NetworkManager)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/snap.network-manager.networkmanager.service
           └─14799 /snap/network-manager/412/usr/sbin/NetworkManager --config-dir=/var/snap/network-manager/412/conf.d/ --config=/snap/network-manager/412/etc/NetworkManager/NetworkManager.conf --log-leve
$ snap connections --all 
Interface              Plug                                   Slot                            Notes
...
network-manager        network-manager:nmcli                  -                               -
...
$ snap connect network-manager:nmcli
$ network-manager.nmcli d
DEVICE           TYPE      STATE         CONNECTION         
enx000ec6e241bf  ethernet  connected     Wired connection 1 
lxdbr0           bridge    connected     lxdbr0             
lxcbr0           bridge    connected     lxcbr0             
mpqemubr0        bridge    connected     mpqemubr0          
virbr0           bridge    connected     virbr0             
veth03RMIL       ethernet  connected     veth03RMIL         
wlp3s0           wifi      disconnected  --                 
maasbr0          bridge    unmanaged     --                 
mpqemubr0-dummy  dummy     unmanaged     --                 
lo               loopback  unmanaged     --                 
virbr0-nic       tun       unmanaged     --                 
$ network-manager.nmcli c
NAME                UUID                                  TYPE      DEVICE          
Wired connection 1  ed72f419-a070-3d3c-9683-a3d4f33d327d  ethernet  enx000ec6e241bf 
lxcbr0              d619a208-3d1b-466b-86f4-51725949cbcd  bridge    lxcbr0          
lxdbr0              fc664f1f-3538-4f7c-8d11-56057307f44a  bridge    lxdbr0          
mpqemubr0           ac07f65c-4827-4ab2-8b05-94825705bfda  bridge    mpqemubr0       
veth03RMIL          5d84ee6f-c691-43b9-a182-b0b8742faeaa  ethernet  veth03RMIL      
virbr0              f5ccaead-23ab-4259-aae7-67f4ab7f1dc8  bridge    virbr0          
Wired connection 2  b4a1ff89-2b85-37db-82ba-b651f7d5a275  ethernet  --      

The critical step you were missing was taking a look at the interfaces and connect the nmcli one, that is why I suggested to look at snap connections --all output. Not all interfaces are auto-connected on installation, for security reasons. Said this, it is a bit strange that that interface is auto-connected on UC systems but not on Desktop. @ijohnson maybe you know why could this be happening?

Nonetheless, you will still see apparmor denials that come from subscriptions of gnome-shell to NM’s dBus signals. The integration of the snap on Desktop is not ideal because, as explained, it is not the main target for the snap, but you should be able to use nmcli and configure the connections as desired.

Finally, I recommend that you remove the network-manager snap and then install the one from the 1.10 track. The reason is that the 1.2 snap does not try to manage ethernet by default, see https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/enable-ethernet-support for details (you need to set the ethernet.enable property).

1 Like

Re: WoWLAN, once you have the snap running, follow https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/reference/snap-configuration/wowlan to configure it. First thing to check though is the support you have for WoWLAN in your HW/wifi driver:

$ sudo iw phy

and take a look at what you see under WoWLAN support section.

It’s not clear to me why it auto-connects on UC systems but not on classic… maybe @jdstrand or @pedronis can comment, they know more about the snap declaration machinery than I do :slight_smile: (I think they’re both sprinting this week though so it might be a while for a response)

Thank you! I set it up, and confirmed that the wake-on-wlan setting was on and that the interface had it enabled. No wake up. Looks like my Thinkpad T460s hardware isn’t compatible. :slight_smile:

Sorry to circle back around to this, but how about updating that store description to save future users some trouble? Do you know if these are in a repo somewhere where I can make a PR? I’m also asking this in the ubuntu channel on freenode. Eventually made my way to https://bazaar.launchpad.net/~ubuntu-core-dev/app-install-data-ubuntu/ubuntu/view/head:/menu-data/network-manager-gnome:nm-applet.desktop which seems like it might be related.

better try the #snappy channel when trying to change some snap related bits :wink:

(#ubuntu is more focused on enduser support than on development …)