DizzyTech
July 16th, 2009, 03:05 PM
I often find myself, despite having a lightning-fast boot with Ubuntu, waiting at my desktop for something to start. I started looking at what I do with my computer, investigating my bottlenecks. One of them was my wireless network. Even though I have a perfectly functional wireless card and I work within mere feet of my router, I often find myself waiting for the wireless to start before opening my web browser.
Background: I recently had a brief stint with Arch Linux due to, well, curiosity. I discovered a very helpful and useful tip when configuring NetworkManager in my Gnome installation. This tutorial is mostly duplication of that, and you may find the Wiki article here (http://wiki.archlinux.org/index.php/NetworkManager).
Most modern Linux distributions include NetworkManager, a very powerful network management daemon. The practical upshot of having NetworkManager in Ubuntu is that you can easily swap between multiple wireless networks, and even between WiFi and ethernet without editing configuration files or using the terminal.
NetworkManager can support automatically unlocking itself and signing in to networks immediately upon the daemon starting. The daemon itself usually starts up even before X and GDM/KDM, so it's running long before you log in. You can use this time to your advantage!
Steps: Still with me?
Make sure you are logged in to the account on your Ubuntu computer that manages wireless networks.
If you don't use encrypted networks or don't have a password on your Gnome keyring, skip ahead to step 5.
Hit Alt+F2. A dialog named "Run Application" will pop up. Enter the following in the dialog, press Enter, and enter your password when asked.
gksudo gedit /etc/pam.d/passwd
A text editor window should open. Skip to the end of the file, and copy and paste the following into a new line at the end of the document. Save and quit.
password optional pam_gnome_keyring.so
Hit Alt+F2. When the dialog "Run Application" pops up, copy and paste the following command into the input box and press enter. If it asks for your password, enter it and hit okay. Nothing else will appear.
gksudo polkit-auth --grant org.freedesktop.network-manager-settings.system.modify --user $USER
Right-click the network icon (if you're on wireless, it should be cellphone-like bars) and hit "Edit Connections...".
http://imgur.com/kr0WQ.png
A "Network Connections" window will pop up. Navigate to the wireless tab.
http://imgur.com/roTK1.png
Select a network that you wish to have connect automatically, and hit "Edit".
http://imgur.com/rqtVF.png
Towards the bottom of the property sheet that comes up, check "Available to all users." Hit Apply. If you are currently connected to this network, the network will disconnect and reconnect.
http://imgur.com/x1vnO.png
Repeat steps 8 and 9 for each network you wish to be able to connect to during boot.
You are done!
From now on, WiFi will immediately start when the NetworkManager daemon does. This is particularly useful if you use the login screen; however, you should also benefit if you automatically login.
Consequences: If your computer is ultra-mobile, or often doesn't stay in the same location, this obviously won't work unless you've been there before. This also opens up WiFi to all users on your computer, but that really shouldn't be an issue.
Undo!: If you wish to undo this hack, substitute the command in step 5 for the following command. As well, redo the steps while unchecking "Available to all users" in step 9.
sudo polkit-auth --block org.freedesktop.network-manager-settings.system.modify --user $USER
Background: I recently had a brief stint with Arch Linux due to, well, curiosity. I discovered a very helpful and useful tip when configuring NetworkManager in my Gnome installation. This tutorial is mostly duplication of that, and you may find the Wiki article here (http://wiki.archlinux.org/index.php/NetworkManager).
Most modern Linux distributions include NetworkManager, a very powerful network management daemon. The practical upshot of having NetworkManager in Ubuntu is that you can easily swap between multiple wireless networks, and even between WiFi and ethernet without editing configuration files or using the terminal.
NetworkManager can support automatically unlocking itself and signing in to networks immediately upon the daemon starting. The daemon itself usually starts up even before X and GDM/KDM, so it's running long before you log in. You can use this time to your advantage!
Steps: Still with me?
Make sure you are logged in to the account on your Ubuntu computer that manages wireless networks.
If you don't use encrypted networks or don't have a password on your Gnome keyring, skip ahead to step 5.
Hit Alt+F2. A dialog named "Run Application" will pop up. Enter the following in the dialog, press Enter, and enter your password when asked.
gksudo gedit /etc/pam.d/passwd
A text editor window should open. Skip to the end of the file, and copy and paste the following into a new line at the end of the document. Save and quit.
password optional pam_gnome_keyring.so
Hit Alt+F2. When the dialog "Run Application" pops up, copy and paste the following command into the input box and press enter. If it asks for your password, enter it and hit okay. Nothing else will appear.
gksudo polkit-auth --grant org.freedesktop.network-manager-settings.system.modify --user $USER
Right-click the network icon (if you're on wireless, it should be cellphone-like bars) and hit "Edit Connections...".
http://imgur.com/kr0WQ.png
A "Network Connections" window will pop up. Navigate to the wireless tab.
http://imgur.com/roTK1.png
Select a network that you wish to have connect automatically, and hit "Edit".
http://imgur.com/rqtVF.png
Towards the bottom of the property sheet that comes up, check "Available to all users." Hit Apply. If you are currently connected to this network, the network will disconnect and reconnect.
http://imgur.com/x1vnO.png
Repeat steps 8 and 9 for each network you wish to be able to connect to during boot.
You are done!
From now on, WiFi will immediately start when the NetworkManager daemon does. This is particularly useful if you use the login screen; however, you should also benefit if you automatically login.
Consequences: If your computer is ultra-mobile, or often doesn't stay in the same location, this obviously won't work unless you've been there before. This also opens up WiFi to all users on your computer, but that really shouldn't be an issue.
Undo!: If you wish to undo this hack, substitute the command in step 5 for the following command. As well, redo the steps while unchecking "Available to all users" in step 9.
sudo polkit-auth --block org.freedesktop.network-manager-settings.system.modify --user $USER