Score:1

NetworkManager cannot find VPN plugin

ve flag

I'm trying to set up two different machines with the same VPN client configuration. Both machines run Ubuntu 20.04, one is without X (Machine B).

Here my NetworkManager configuration file that works on machine A:

[connection]
id=myVPN
uuid=blabla-blabla-blabla
type=vpn
autoconnect=false
permissions=user:mark:;

[vpn]
IKE DH Group=dh2
IPSec ID=myID
IPSec gateway=myGateway
IPSec secret-flags=1
Local Port=0
NAT Traversal Mode=natt
Perfect Forward Secrecy=server
Vendor=cisco
Xauth password-flags=1
Xauth username=myUser
ipsec-secret-type=save
xauth-password-type=save
service-type=org.freedesktop.NetworkManager.vpnc

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]

I copied this file to machine B and issued:

$ sudo nmcli connection import type vpn file myVPN.nmconnection
Error: failed to find VPN plugin for vpn

I checked for packages on both machines:

Machine A

$ dpkg -l | grep network-manager
ii  network-manager                                   1.22.10-1ubuntu2.2                              amd64        network management framework (daemon and userspace tools)
ii  network-manager-config-connectivity-ubuntu        1.22.10-1ubuntu2.2                              all          NetworkManager configuration to enable connectivity checking
ii  network-manager-gnome                             1.8.24-1ubuntu3                                 amd64        network management framework (GNOME frontend)
ii  network-manager-openvpn                           1.8.12-1                                        amd64        network management framework (OpenVPN plugin core)
ii  network-manager-openvpn-gnome                     1.8.12-1                                        amd64        network management framework (OpenVPN plugin GNOME GUI)
ii  network-manager-pptp                              1.2.8-2                                         amd64        network management framework (PPTP plugin core)
ii  network-manager-pptp-gnome                        1.2.8-2                                         amd64        network management framework (PPTP plugin GNOME GUI)
ii  network-manager-vpnc                              1.2.6-2                                        amd64        network management framework (VPNC plugin core)
ii  network-manager-vpnc-gnome                        1.2.6-2                                        amd64        network management framework (VPNC plugin GNOME GUI)

Machine B

$ dpkg -l | grep network-manager
ii  network-manager                            1.22.10-1ubuntu2.2                    amd64        network management framework (daemon and userspace tools)
ii  network-manager-config-connectivity-ubuntu 1.22.10-1ubuntu2.2                    all          NetworkManager configuration to enable connectivity checking
ii  network-manager-openvpn                    1.8.12-1                              amd64        network management framework (OpenVPN plugin core)
ii  network-manager-pptp                       1.2.8-2                               amd64        network management framework (PPTP plugin core)
ii  network-manager-vpnc                       1.2.6-2                                        amd64        network management framework (VPNC plugin core)

As you can see, they are identical except the GUI packages that I don't need on the headless machine.

Is there any other packages (not from network-manager-*) that I need to install on Machine B?

UPDATE

Things getting worst. On Machine A, where the connection above lives and runs fine I issued the following commands:

$ nmcli connection export myVPN ~/export-myVPN
$ nmcli connection import type vpn file ~/export-myVPN
Error: failed to find VPN plugin for vpn

Wow! It cannot import the file it has just exported on the same machine!

The help says:

$ nmcli connection import --help
Usage: nmcli connection import { ARGUMENTS | help }

ARGUMENTS := [--temporary] type <type> file <file to import>

Import an external/foreign configuration as a NetworkManager connection profile.
The type of the input file is specified by type option.
Only VPN configurations are supported at the moment. The configuration
is imported by NetworkManager VPN plugins.

So I also tried with type VPN with no chance. I don't want to believe I must install Gnome only to configure the VPN using the GUI.

UPDATE 2

I spent several hours but I was not able to import the file even on the same machine that exported it (with full Gnome installed).

So I did the following - ugly - workaround:

  1. install gnome-session gdm3 network-manager-gnome
  2. from the GUI frontend import the very same file I was trying to import using nmcli
  3. remove the above packages
  4. run the new VPN connection using nmcli
Yvain avatar
us flag
org.freedesktop... this is gnome data bus, install openvpn-gnome even though you have no desktop or remove this line.
ve flag
@Yvain the package `openvpn-gnome` does not exist. If you meant `network-manager-openvpn-gnome` it does not solve the problem
ve flag
@Yvain You suggest to remove the line: is not mandatory to set the `service-type` then?
Yvain avatar
us flag
Since the service-type is refered as a gnome data bus object, it means that you need gnome if using this line. My guess would have been to remove the line and see what it says. Otherwise, when installing network-manager-openvpn-gnome, does it install gnome itself ? The package on its own would be useless but I doubt linux aptitude would leave you with a broken package so then it must have installed it.
Yvain avatar
us flag
network manager is part of gnome, installing gnome doesn't mean installing gnome desktop. I duckduckgoed mmcli vpn and found this link: https://developer-old.gnome.org/NetworkManager/stable/nmcli-examples.html The point is not about reading the article but just showing that NetworkManager is a gnome application, with a cli interface in case you have no desktop. Please install gnome.
ve flag
@Yvain I understand your explanation, but there is no `gnome` package. I installed `network-manager-openvpn-gnome` and the other gnome-related package for `network-manager` (I'm not using openvpn by the way). But I had to install the gnome desktop in order to import the file - see UPDATE 2.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.