11

I leave my laptop at home 95% of the time. I would like it to connect to my wireless network without me having to login. And, just as important, I'd like it NOT to DISconnect when I log off.

I'm using Fedora, but Ubuntu instructions are welcome too.

6 Answers 6

5

I guess this question was asked a while ago, but this feature has been added to recent versions of Network Manager. See here.

3
  • As of May 2011 that link says: On version 0.7.1 or later edit the profile of the connection you with to start prior to login and select the box in the bottom left "Available to all users"
    – Joe
    May 4, 2011 at 13:24
  • Also, it's not working for me on an odroid running the provided Ubuntu 14.04 image. Aug 18, 2015 at 14:02
  • This answer (and linked documentation) is obsolete, at least as of Ubuntu 14.04. The obsolete info in that FAQ, of course, has not been removed. Aug 18, 2015 at 14:48
3

The issue with this idea is that the NetworkManager service takes its commands from nm-applet (or the KDE analogue, if you're in KDE. To avoid confusing myself, I'll assume you're in GNOME). There is a command-line NetworkManager interface in the repositories called cNetworkManager (that's, oddly enough, written in Python). You could try to stick a command to connect to your network using cNetworkManager in a startup script (I'm not entirely sure where you'd have to put this script, but I know it's possible :D). I don't know whether or not this approach will connect or if it'll stay connected after you logout, but i DO know that there are at least 2 issues you'll have to reconcile.

1) You'll have this script fighting with nm-applet. If you want to do this, i'd disable nm-applet from starting automatically (which should be configurable in either preferences -> sessions or preferences -> startup programs, depending on whether or not you're using fedora 11).

2) if you ever want to change networks (and do fancy things like automatically detect them), you'll either have to do so using cNetworkManager (which is a real pain), or start up nm-applet and lose your ability to keep the connection open after you logout.

Best of luck, and let us know if this works!

3
  • I'm on a Windows machine at work; I'll test that when I get home. It would be nice if NetworkManager and nm-applet resided in different packages.
    – JCCyC
    Jul 31, 2009 at 15:35
  • I think that having them in the same package is actually essential; what's the point of giving us a service if you don't give us a method to control it? I'd argue in the opposite direction; cNetworkManager should also be in the NetworkManager package, for when you need to control your wireless card when X doesn't run (this has happened to me an emnbarrasingly large number of times)
    – Babu
    Jul 31, 2009 at 17:27
  • I'm not sure if this cNetworkManager exists as of 2015. There is an "nmcli" tool that, I believe, is installed by default and lets you work with network-manager from the cli. Aug 18, 2015 at 14:51
2

I had the same issue and I ended up removing NetworkManager completely and using wpa_supplicant directly instead. It works in the opposite kind of way - you have a config file with all the networks you want to connect to automatically, and a GUI that can either override it during runtime (and connect to a different network), or to change the config file.

I used this tutorial to set up my Debian, and I didn't have too many issues with it (its same as Ubuntu): http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/branches/unstable/debian/README.Debian?op=file&rev=0&sc=0

1

I have used Andrew Wagner's method on Fedora 22 for a connection with WPA security.

  1. Create the connection "demo" us usual using the GUI.

  2. As root create a file /etc/NetworkManager/wifipw with the one line entry:

    802-11-wireless-security.psk:wpa-pw 
    

where wpa-pw is the wifi password.

  1. Add the following line to the crontab for root:

    @reboot sleep 10; /usr/bin/nmcli conn up id demo passwd-file etc/NetworkManager/wifipw
    

The sleep 10 was necessary on my system to give the device time to initialise before trying to connect.

0

May be that is not an option for you, but you could setup network via config files as in the tutorial. It is for Ubuntu, but I didn't noticed the difference. Network would be switched on during OS booting process.

2
  • This is a good solution, but there are also caveats with this. The NetworkManager and network services should not be run at the same time; they'll both try to control the wireless hardware at the same time and do weird things. What you could do is enable the network service by default, and only enable networkamanager when it's required.
    – Babu
    Jul 31, 2009 at 4:38
  • That's true. Jul 31, 2009 at 7:48
0

Here is what I did (on an odroid arm board running Ubuntu 14.04):

Set up the network connection using, i.e. nm-applet, as your normal user, give it a name, i.e. "Decktop Demo". You probably need to check the General->"All users may connect to this network" box.

Edit "the cron" as superuser:

sudo crontab -e

select your editor of choice if prompted, and add a line at the bottom:

@startup /usr/bin/nmcli conn up id "Desktop Demo"

sacrifice a small animal to the gods of network-management and reboot.

This method has the advantage of doing everything through network-manager, so it ~should play nice the gui network management applets for various desktops, i.e. nm-applet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .