WireGuard VPN plugin for NetworkManager in GNOME 3 on Debian 11 Bullseye

screenshot of GNOME / NetworkManager showing the WireGuard plugin

By default, GNOME 3’s VPN configuration tool for NetworkManager supports IPSEC VPNs, but not WireGuard. I want WireGuard support because:

Some kind and clever person has created a plugin.

I followed the guidance here to install it.

The guide almost worked for me, but I needed a couple of extra packages (intltool and libtool).

Here’s what worked for me:

sudo apt install build-essential libgtk-3-dev libnma-dev libsecret-1-dev intltool libtool -y
git clone https://github.com/max-moser/network-manager-wireguard
cd network-manager-wireguard
./autogen.sh --without-libnm-glib
./configure --prefix=/usr  --without-libnm-glib --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var
make   
sudo make install

(I note that the plugin uses the name “Wireguard”, but the trademarked name is “WireGuard”. Oh well.)

#Update

I was trying this on my PinePhone Pro, and I couldn’t get it to work. The error was, I think, more to do with the WireGuard installation than with this plugin, but, hey, it is working now:

sudo apt install resolvconf -y

Update for Debian Bookworm / GNOME 4

The instructions above still work, but the resulting plugin does not work.

To make it work, after downloading the code from Github, replace the default /src/nm-wireguard-service.c with this updated /src/nm-wireguard-service.c, then finish the installation as above.

But it still doesn’t work reliably - perhaps better to use Network Manager’s WireGuard support, although that has less control around starting automatically.