You are not logged in.

#1 2016-04-28 18:06:33

Tom B
Member
Registered: 2014-01-15
Posts: 187
Website

Networkmanager - Connect before logging in?

Is there any way to configure NetworkManager to connect before logging in? The wiki has a section "Automatically unlock keyring after login" but this isn't helpful to me, I'm using the PC as a fileserver and want to automatically connect to wifi on boot. Is this possible?

Offline

#2 2016-04-28 21:44:09

NightSinner
Member
From: Netherlands/Bulgaria
Registered: 2011-05-15
Posts: 9

Re: Networkmanager - Connect before logging in?

The thing that comes to my mind at the moment is to create a script that is run at boot to use wifi-menu to connect to the Wi-Fi. If you have created a profile using wifi-menu it should (if I remember correctly as I cannot test it atm) keep the password to the network and connect automatically.

Offline

#3 2016-04-29 02:52:33

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Networkmanager - Connect before logging in?

if using wifi-menu, there is no need to write script, netctl is designed to work with wifi-menu.

Offline

#4 2016-04-29 02:55:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Networkmanager - Connect before logging in?

If it's set to start on boot, it should connect.

Offline

#5 2016-04-29 07:26:32

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: Networkmanager - Connect before logging in?

you need to tick the option "allow all users to connect to network" or something like that.

Offline

#6 2016-04-29 12:33:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Networkmanager - Connect before logging in?

None of this makes much sense.  Any service managed by systemd and enabled will start as soon as it can regardless of whether or not you've logged in to your desktop (or even to a tty).  I've never used NetworkManager, but the wiki seems to confirm that it is no exception to this rule:

wiki wrote:

NetworkManager is controlled via NetworkManager.service. Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need nmcli or an applet to configure and connect.

There is also no need to configure network manager to allow all users to do anything, as systemd starts the process with all needed privileges (unless you run NetworkManager under a --user session, which is not the normal use from what I can tell).

That said, most network connections can take several seconds to set up before they are fully active.  If you do not have network access as soon as you are in your desktop, it may not be because NM is waiting for you to log in, but it is simply still in the process of connecting.

This leads me to suspect there may be an X-Y problem here.  Is there an actual problem you are facing?  What is it?  What are the actual symptoms?  Starting NM before you log in is not a solution you should pursue as - again - that is the default and likely what is already happening.  But if there are symptoms you'd like to change, we need to know what they are in order to identify the actual problem and see if there might be a solution.

If you just want a connection faster, there might not be much that can be done if you need to wait for a dynamically assigned IP.  Using a static IP *might* be faster (I have no experience with this so I'm not actually sure) - but again, we need to know what the actual problem is or symptoms are before any steps can be recommended.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2016-04-29 12:49:30

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: Networkmanager - Connect before logging in?

Trilby wrote:

There is also no need to configure network manager to allow all users to do anything, as systemd starts the process with all needed privileges (unless you run NetworkManager under a --user session, which is not the normal use from what I can tell).

Allowing all users to connect to a network is the same as creating a "system connection" in your quote from the documentation. I can't remember exactly, but it says something like "allow all users to use this network".

Offline

#8 2016-05-04 17:27:10

Tom B
Member
Registered: 2014-01-15
Posts: 187
Website

Re: Networkmanager - Connect before logging in?

Trilby wrote:

This leads me to suspect there may be an X-Y problem here.  Is there an actual problem you are facing?  What is it?  What are the actual symptoms?  Starting NM before you log in is not a solution you should pursue as - again - that is the default and likely what is already happening.  But if there are symptoms you'd like to change, we need to know what they are in order to identify the actual problem and see if there might be a solution.

If you just want a connection faster, there might not be much that can be done if you need to wait for a dynamically assigned IP.  Using a static IP *might* be faster (I have no experience with this so I'm not actually sure) - but again, we need to know what the actual problem is or symptoms are before any steps can be recommended.

Yes, you may be right. I had a play with the "any users" option, but it didn't seem to help. As far as I can tell the problem is this:

KDE stores the wifi password in kwallet and the wallet is not unlocked until I log in.

Offline

#9 2016-05-04 17:29:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Networkmanager - Connect before logging in?

Tom B wrote:

KDE stores the wifi password in kwallet and the wallet is not unlocked until I log in.

Ah, thanks, that's what I was missing as I don't use these DE tools.  But I know that this is not required to use NetworkManager.  You can run networkmanager as a system service and provided it is configured at the system level rather than user level it will start immediately on boot.

A user wallet seems an odd place for a wifi password as the network connection is a system resource not a user resource.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2016-05-04 17:35:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Networkmanager - Connect before logging in?

Yep, that makes no sense at all. Even if it is the case, forget the GUI tools and just set up the connection with the cli tool or by hand (in /etc/NetworkManager/system-connections/).

Offline

Board footer

Powered by FluxBB