How to install and configure NetworkManager and network-manager-applet on Arch Linux with Gnome3
In this article I will describe how to make networkmanager and the network-manager-applet (aka nm-applet) work on Arch Linux with GNOME3. Of course there are other networking-tools available, however I prefer the use of networkmanager and network-manager-applet, because they integrate them selves very well into GNOME3.
check the configuration of your /etc/hosts file, a valid configuration looks like this:
#<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain yourHostname ::1 localhost.localdomain yourHostname
You can identify your networking-devices like this:
$ lspci | grep -i net
If your device is not listed, it is maybe an usb-device, so try this command:
With the following command you can check the current state of all your network-devices:
$ ip link
- Install the wpa_supplicant tools
$ sudo pacman -S wpa_supplicant
- Install the wireless tools
$ sudo pacman -S wireless_tools
- Install the networkmanager
$ sudo pacman -S networkmanager
- Install the network-manager-applet aka nm-applet
$ sudo pacman -S network-manager-applet
- Install gnome-keyring
$ sudo pacman -S gnome-keyring
Attention: This is the old and by now depricated way, continue at step 4.:
Deactivate or remove the previously used network daemon from /etc/rc.conf and add instead the networkmanager daemon, also make sure to comment the network section at the end of the file. It is very important to place the networkmanager after dbus and before any network-services like ntpd. Before applying any of the changes the contents of /etc/rc.conf will look similar to this:
# /etc/rc.conf - configuration file for initscripts # # Most of rc.conf has been replaced by various other configuration # files. See archlinux(7) for details. # # For more details on rc.conf see rc.conf(5). DAEMONS=(hwclock syslog-ng network crond acpid dbus ntpd avahi-daemon cupsd) # Storage # # USEDMRAID="no" # USELVM="no" # Network # interface=eth0 # address= # netmask= # gateway=
After applying the mentioned changes the file should look like this:
# /etc/rc.conf - configuration file for initscripts # # Most of rc.conf has been replaced by various other configuration # files. See archlinux(7) for details. # # For more details on rc.conf see rc.conf(5). # DAEMONS=(hwclock syslog-ng crond acpid dbus networkmanager ntpd avahi-daemon cupsd) # Storage # # USEDMRAID="no" # USELVM="no"# Network # interface=eth0 # address= # netmask= # gateway=
- Stop the network daemon:
$ sudo rc.d stop network
- Create a new PolicyKit rule
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla with the following contents:
[nm-applet] Identity=unix-group:network Action=org.freedesktop.NetworkManager.* ResultAny=yes ResultInactive=no ResultActive=yes
- Make the networkmanager start on boot:
$ sudo systemctl enable NetworkManager.service
- Disable dhcpcd
Since networkmanager wants to be the one who handles the dhcpcd related stuff, you have to disable and stop dhcpcd:
$ sudo systemctl disable dhcpcd.service $ sudo systemctl disable dhcpcd@.service $ sudo systemctl stop dhcpcd.service $ sudo systemctl stop dhcpcd@.service
- Enable wpa_supplicant, if you want to use your wireless connection:
$ sudo systemctl enable wpa_supplicant.service
- Add your user to the network group:
$ gpasswd -a USERNAME network
- Turn off network interface controllers:
Turn off your network interface controllers, in my case eth0 and wlan0:
$ ip link set down eth0 $ ip link set down wlan0
- Now start wpa_supplicant:
$ sudo systemctl start wpa_supplicant.service
Attention: This is the new and right way, so leave step 1), 2) and 3) out:
- Finally start the networkmanager:
$ sudo systemctl start NetworkManager.service
If you get an error about unreachable D-Bus, just ignore it.
If the networkmanager is not running and network-manager-applet does not show up in your upper GNOME3 panel, try this:
$ sudo Networkmanager $ nm-applet
Now at least your wired connection should be working correctly. If not reboot your system. If you have problems with your wireless connection, read the next part of this post 3. Wireless troubleshooting.
3. Wireless troubleshooting
- Take a look at the logs
If you take a look at /var/log/daemon.log you will find many repeating entrys like these:
NetworkManager: (wlan0): supplicant interface state: associating -> associated NetworkManager: (wlan0): supplicant interface state: associated -> disconnected NetworkManager: (wlan0): supplicant interface state: disconnected -> scanning NetworkManager: (wlan0): supplicant interface state: scanning -> authenticating NetworkManager: (wlan0): supplicant interface state: authenticating -> associating NetworkManager: (wlan0): supplicant interface state: associating -> 4-way handshake NetworkManager: (wlan0): supplicant interface state: 4-way handshake -> disconnected
The entrys correspond to the repeated requests of the network-manager-applet for the PSK.
- run the following command:
If the output shows you at least two sessions e.g. called Session1 and Session2, than there is something wrong.
- Edit .xinitrc
To fix this problem open your ~/.xinitrc and change the line:
exec ck-launch-session gnome-session
exec dbus-launch gnome-session
- It is very likely that your wireless connection will not work out of the box.
- In my case the network-manager-applet asked me in an endless loop for the WPA/WPA2 PSK of my router.
This should solve the problem with the multiple sessions and your wireless connection should work correctly after rebooting your system. At least this is how I was able to fix my wireless connection.
Posted on September 15, 2012, in Configure, Install, Network, Troubleshooting and tagged Arch, Archlinux, gnome 3, gnome-session, gnome3, LAN, linux, linux command line, Linux M0nk3ys, Linux Monkeys, network, network-manager-applet, networkmanager, nm-applet, troubleshoot, wifi, wireless, Wireless network, wireless-tools, wlan. Bookmark the permalink. 24 Comments.