# Unable to add new Wifi networks after migration to systemd

## adimanav

I'm using KDE and I recently switched to systemd. Everything's working except I lost the existing Wifi connections set up using networkmanagement. And when I try to connect to a network I get the error popup "Error adding connection: Insufficient privileges". After doing some research on the internet I see that the output of the command 

```
loginctl session-status 1
```

 does not show NetworkManager. Maybe this is the reason and I don't know how to fix it. Can anyone help out? Thanks in advance.

----------

## croutch

Hello.

Have you started networkmanager?

systemctl enable NetworkManager

systemctl start NetworkManager

Sheck if your usersession  is active with. 

loginctl show-session $XDG_SESSION_ID

----------

## adimanav

Yes I enabled and started NetworkManager. Networkmanagement widget even shows the available WiFi networks. Just errors out on trying to connect to one. Loginctl show-session tells me that the session is active.

----------

## TomWij

Is your user in the wheel group? Does `journalctl -rb` after trying to connect to a network yield more details?

----------

## adimanav

Yes my user is in the wheel group. Journalctl does not show any info.

----------

## adimanav

I reemerged kde-misc/networkmanagement with debug useflag but no useful info from there. The error is being thrown from the NetworkManager backend.

----------

## croutch

When googling this line- Error adding connection: Insufficient privileges systemd.

Everything points to policykit/consolekit/pam. 

https://www.google.se/?gws_rd=cr&ei=qAp2UoPzAcKe4gSEu4CACQ#q=Error+adding+connection%3A+Insufficient+privileges+systemd

----------

## TomWij

Ah, made a wrong guess, though I remember the wheel group being important for other parts; you'll want the plugdev group as well.

See /usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules as to why that is.

----------

## adimanav

The user is in the plugdev group as well. Things were working fine when I had consolekit. All I did was disable consolekit and add the systemd useflag and update. Then I enabled the various services. Except for WiFi everything else is working. I tried a LAN cable and that works too. So here am I typing from my tablet. I'm emerging gnome to see if that changes anything though I doubt it. I hope I don't have to revert back from systemd.

----------

## croutch

Can this help you?

https://wiki.archlinux.org/index.php/NetworkManager#Set_up_PolicyKit_permissions

----------

## adimanav

Thanks for the info. The user is already in wheel (as recommended by the article) and plugdev group so that should not be the issue. Thing is since NetworkManager was working fine without systemd, should there be any need to mess around with Polkit settings?

For the time being I'm using the wpa_supplicant@ service and manually entered info in the conf file. Of course would be awesome to get NetworkManager working with systemd.

As an aside I see that I'm not able to shutdown or restart the machine from the Gnome menu. Another systemd related issue?

----------

## TomWij

Did you follow the systemd and GNOME 3.8 upgrade guide?

http://wiki.gentoo.org/wiki/systemd

http://wiki.gentoo.org/wiki/GNOME/3.8-upgrade-guide

From what I remember you need to switch from consolekit to polkit and make sure you enable the systemd USE flag globally.

----------

## croutch

Start here first

https://wiki.archlinux.org/index.php/WPA_supplicant

http://wiki.gentoo.org/wiki/Wpa_supplicant

https://wiki.archlinux.org/index.php/Wireless

http://wiki.gentoo.org/wiki/Wifi

Take a look at last post date is from 2013-09-25.

https://bbs.archlinux.org/viewtopic.php?id=170353

dhcpcd@.service starts wpa_supplicant when adressed to a wireless adapter by itself so wpa_supplicant@.service is no longer needed.

That sounds to me if you disable all wifi that you find with systemctl,and have networkmanager enabled. Networkmanager should  pick it up autmatically on reboot??

----------

## adimanav

@TomWij, Yes I followed the systemd and Gnome 3.8 upgrade guide. I already had the policykit useflag enabled. Just removed the consolekit useflag and enabled systemd useflag globally.

@croutch, wifi is working with dhcpcd and wpa_supplicant. On using NetworkManager it picks up the available wifi connections but does not let me connect/add any.

With Gnome 3.8 I'm seeing the following error in the logs when I try to connect to a wifi network using nm-applet, "gnome-session[3826]: Window manager warning: Log level 16: Device activation failed: (32) Not authorized to control networking."

----------

## adimanav

I think I found the reason. I'm running hardened Gentoo with CONFIG_GRKERNSEC_PROC set in the kernel. It apparently interferes with systemd. Someone had opened a bug for that https://bugs.freedesktop.org/show_bug.cgi?id=65575

Let me see if things work fine after unselecting that kernel option...

----------

## adimanav

Yup, that solved it!

Thanks folks for your help!

----------

## TomWij

 *adimanav wrote:*   

> I think I found the reason. I'm running hardened Gentoo with CONFIG_GRKERNSEC_PROC set in the kernel. It apparently interferes with systemd. Someone had opened a bug for that https://bugs.freedesktop.org/show_bug.cgi?id=65575
> 
> Let me see if things work fine after unselecting that kernel option...

 

Filed a bug about this at https://bugs.gentoo.org/show_bug.cgi?id=490366 and thank you for discovering this.

----------

## TomWij

Change has been committed by mgorny; the sys-apps/systemd package now checks for it to be disabled, thanks again.

----------

