26

Is it possible to get Network Manager working on Raspbian? It's easy to install with:

sudo apt-get install network-manager

but I couldn't get it to manage any of my connections. Unfortunately, it looks like only a old version of NM is available in the Debian repo.

Milliways
  • 54,718
  • 26
  • 92
  • 182
Cerin
  • 2,211
  • 7
  • 30
  • 49
  • If you want some graphical interface to manage network connections, try `wicd-curses`. http://blog.ubidots.com/setup-wifi-on-raspberry-pi-using-wicd provides a tutorial. – bigbang May 21 '15 at 07:21
  • Try to purge the packages openresolv and dhcpcd5. I did it and NM started working without issues. – rkachach Oct 06 '20 at 10:04

4 Answers4

33

I have found how to get NetworkManager (and systemd-resolved) working on Raspbian 9 (Stretch). NetworkManager is very useful when you need to manage multiple VPN connections with split DNS, wifi networks and other advanced network settings directly from the Pixel Desktop.

Here is how to do it:

  1. Install the needed packages with the following command:

    sudo apt install network-manager network-manager-gnome openvpn \
    openvpn-systemd-resolved network-manager-openvpn \
    network-manager-openvpn-gnome
  2. Remove unneded packages:

    sudo apt purge openresolv dhcpcd5
  3. Replace /etc/resolv.conf with a symlink to /lib/systemd/resolv.conf:

    (do not execute this command on Raspbian 10, it will break your DNS)

    [only for Raspbian 9, not 10]
    sudo ln -sf /lib/systemd/resolv.conf /etc/resolv.conf
  4. Now go to the top of your screen and reconfigure the panel:

    1. Open "Panel Settings"
    2. In "Panel Applets" remove the "Wireless & Wired Network" item.
    3. The network manager applet should appear after a reboot.
jathanasiou
  • 103
  • 1
giox069
  • 431
  • 4
  • 4
  • 2
    Thank you! The purge step was vital. Without that, nmcli showed all my devices as "unavailable" and it couldn't control them. – Luke Nov 05 '17 at 06:31
  • 2
    You don't actually need `openvpn`. – Zimano Jul 20 '18 at 09:13
  • I had a problem where my raspberry wouldn't connect to the internet through Ethernet. I had to undo step 3 (I kept backup), and then everything worked perfectly - Thanks – loxaxs Aug 31 '18 at 11:36
  • I plugged my laptop (Ubuntu 14) to my RPi 3 (Raspbian Stretch) via ssh over an Ethernet cable. Doing nmcli dev wifi on the laptop gives me a whole bunch of networks. Typing the same command on the R Pi gives me no network at all. I went through the steps you decribed (without error message or anything suspicious along the way)... but nmcli still doens't detect anything. Any idea why? Could it have to do with the ethernet connection? – hartmut Dec 06 '18 at 15:59
  • 2
    @luke The purge step isn't vital at all. NetworkManager just doesn't touch managed devices (like those configured in /etc/interfaces) – Zimano Dec 18 '18 at 14:56
  • 4
    This answer would be better without step 3. I've just tested it on a fresh Raspbian Buster install (September 2019 version) on a Raspberry Pi 4 Model B. Step 3 is redundant and breaks the DNS. – John Forbes Dec 17 '19 at 04:44
  • 1
    How do I reverse step 3? These steps broke my ethernet connection. – Steve W Jan 29 '20 at 18:19
  • I've only done step 1 and step 2, restarted and now the ethernet connection is not working at all, how to fix that? – Mike Apr 09 '20 at 13:28
  • To reverse step 3, delete the link: `sudo rm /etc/resolv.conf` – leanne Jul 04 '20 at 00:47
  • It seems that the purge is the key line. I was having issues and once I purged these two packages the NM started working correctly. Thanks. – rkachach Oct 06 '20 at 10:03
11

This page ranks quite highly in search results for people looking for networking help on Raspberry Pi. Unfortunately, the steps detailed here are out-of-date as of Feb 2020.

At that point in time, to get Network Manager handling wifi on current Pi OS:

sudo apt update
sudo apt install network-manager network-manager-gnome

Check /etc/network/interfaces - it should be empty except for an include from /etc/network/interfaces.d. Now edit /etc/dhcpcd.conf and add:

denyinterfaces wlan0

edit /etc/NetworkManager/NetworkManager.conf:

[main]
plugins=ifupdown,keyfile
dhcp=internal

[ifupdown]
managed=true

Restart, and you should have Network Manager in your menu bar, handling the wifi interface.

I've a few more details of what I did to make this work in this gist, including an alternative approach using a configuration file in /boot.

Unfortunately, I can't confirm that any of this still works as I no longer have access to the corporate network which requires Network Manager. But comments on the gist suggest that it's worked for at least some others. Good luck!

  • I had been on your gist some few minutes ago. Now I find you here. Thanks for writing the gist and reporting on SE. – joaquin Sep 24 '20 at 18:57
  • Another approach that may be of interest is `systemd-networkd`; there's a [comprehensive Q&A on how to set that up here](https://raspberrypi.stackexchange.com/questions/108592/use-systemd-networkd-for-general-networking) for Raspberry Pi. It also works for those that run "headless" - or the "Lite" version of the distro. – Seamus Oct 09 '20 at 05:14
  • You are truly my lord and saviour =). Switching over to `NetworkManager` is probably the easiest way to get WiFi settings working in GUI, if using Gnome. – cyqsimon Jun 24 '21 at 15:58
  • This is the answer for Raspbian 10. Thanks! – Jay Douglass Jun 28 '21 at 21:25
  • And Raspbian 11 – Dan Apr 14 '22 at 07:49
  • I got it working, the network manager connects to my LTE module but I have no internet. Any idea why? – Miguel Apr 26 '22 at 09:33
9

Try using wicd:

sudo apt-get install wicd

Wicd is a network manager application (wireless and wired), it a good alternative to Network Manager

sam coleman
  • 175
  • 4
  • 9
    It would be helpful to at least try to explain how `wicd` is going to help the OP. Feel free to edit your post accordingly. – Ghanima Apr 20 '15 at 17:18
  • 1
    http://raspberrypi.stackexchange.com/a/9750/894 WICD curses exaplined – Piotr Kula Dec 17 '15 at 13:08
  • 2
    This does not attempt to answer the question, the OP asked how to install NetworkManager (not "a network manager") on Raspbian. `wicd` presents an easy TUI for managing networking, but so does `nmtui` that comes with NetworkManager. I don't see how acknowledging that `wicd` can be used for managing networks relates to the question of how to install `NetworkManager`. – Zimano Jul 20 '18 at 12:00
  • 1
    WICD does not work properly on raspbian Stretch. It continually doesn't bring the WLAN back up after disconnection saying that you have to "manually do it" making it useless. Development seems to have been abandoned as there haven't been updates for years. – Rob Mascaro Jul 21 '19 at 06:14
  • wicd is still a python2 programm - don't use it until there is a python3 port – schnedan Oct 09 '20 at 16:49
0

The following worked for me:

sudo apt install network-manager network-manager-gnome
sudo service dhcpcd stop 
sudo service network-manager restart
Chien
  • 1