Gnome network manager can't import any openvpn config file (.ovpn) after upgrading ubuntu to 16.04 version;

I get the following error message when I try to import openvpn config file:

The file 'file-x.ovpn' could not be read or does not contain recognized VPN connection information Error: the plugin does not support import capability
  • This has been resolved and answered here: askubuntu.com/questions/760664/ubuntu-16-04-openvpn?lq=1 – Kestrell Apr 26 '16 at 5:14
  • 2
    Hi Kestrell ...Thank you for your answer************* I already installed required packages and successfully setup openvpn manually: **********but my problem is that i can't import openvpn config files using network manager – ahooee Apr 30 '16 at 11:12
  • 2
    Did you ever get this working? – Seth May 16 '16 at 2:14
  • 1
    before reading any more, check that network-manager-openvpn is installed. – FlipMcF Mar 5 '19 at 21:26

11 Answers 11


My setup

I also had the same issue, trying to import on an Ubuntu 16.04 client a .ovpn file produced by a home pritunl server.

The .ovpn file contained comment lines (#) as well as inline certificates (<ca>, <tls-auth>, <cert>, <key>). And there was no apparent reason to remove comments or keys. This same .ovpn had already been successfully imported into the Kubuntu 16.04 network manager, with only a warning about reneg-sec being too high; A clue to import issues on Ubuntu 16.04.

Solving the OP's errors

  1. The reneg-sec value is too high and encounters known import bug:

    reneg-sec 2592000

    Comment it out or use default value 3600.

    #reneg-sec 2592000

    This value can be re-set from Advanced settings in VPN config tab under:


  2. The config had two remote definitions:

    remote hostname.org 14195 udp6
    remote hostname.org 14195 udp

    Try with only one:

    #remote hostname.org 14195 udp6
    remote hostname.org 14195 udp

After these two modifications, there were no import errors.

Further issue with remote configuration

Although there was no import error any more, the remote was not imported properly, i.e. the port and protocol were not properly parsed, so I had to further break the remote directive down in the .ovpn file as follows

    remote hostname.org
    port 14195
    proto udp


My .ovpn file contained comments as well as inline certificates, etc.. After reading some other posts, I thought the problem lied in the inline files or the comments, so I split the inline certificates and keys into separate files and removed all comments.

So in the end, after applying the above fixes, the .ovpn file with the inline keys and comments was imported.

  • 2
    Thanks the reneg-sec value is the reason I could not import my .ovpn file. There is a network-manager bug report: bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/… – Cas Jul 6 '17 at 10:00
  • 1
    Thanks, I also had to check "Use LZO data compression" in the advanced options of Network Manager (I use OpenVPN Access Server). And be careful of DNS leaks! Without firewall rule to block DNS queries on the Ethernet / WiFi interface, there was a DNS leak, even when using my own DNS server IP and with "block-outside-dns" rule for OpenVPN 2.3.10 (via Network Manager). You can check for DNS leaks on the website dnsleaktest.com and double check with a tool like Wireshark. – baptx Jan 18 '18 at 19:47
  • Splitting the certificates in other files allowed me to import successfully. I also had to use tls-remote instead of verify-x509-name for it to work – Pierre de LESPINAY May 12 '18 at 12:55
  • 2
    Googling, it seems there are MANY MANY reasons why the file could not be parsed. Isn't a way to get a more verbose message on what caused the parsing error trying to import the .ovpn file ? – Antonello May 9 '19 at 14:46

The issue for me was the following line in my .ovpn file:

route remote_host net_gateway

Commenting out this line allowed me to import the connection.

  • 3
    Ubuntu 18.04 and still had this issue. Commenting this line out (from Sophos XG config) fixed it. – Jasin Jun 3 '18 at 2:32
  • ubuntu 19.04 same issue, commenting out this line fixed error – stetoc Aug 5 '19 at 8:36
  • Same is true for ubuntu 19.10 (also Sophos .ovpn config). – Pabi Jan 7 '20 at 22:26
  • 1
    Also applies to Ubuntu 20.04.01 LTS – Frank Schmitt Oct 8 '20 at 10:22

I also have Ubuntu 16.04, and the same problem occurs. The solution is not a very good solution, because you need another computer already connected with the VPN.

Check that you have already installed openvpn and network-manager, from the terminal:

$ sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome
$ sudo systemctl restart network-manager

In general, this should work, but in very few cases (and i don't know why - i suppose that's probably a bug) a .ovpn can't be imported.

So, follow theses steps:

  1. On the computer that already have a created connection with the VPN, select the vpn connection

  2. make empty the password

  3. click on export button

At this point, you'd have a ".conf" file.

  1. open the ".conf" file and edit any parts that reference files on your computer if exists

  2. In your computer, create a new connection with the ".conf" file.

  • that happened to me as well. Luckily I had a laptop already configured and could use that trick to configure my new computer. Quick note though: I had to configure username, password, key file and advanced TLS key file again. – igorsantos07 Aug 2 '16 at 18:15

In my case it was necessary to remove all the comments (starting with #) from the *.ovpn. Some people found also that the line containing "remote SERVER NNNN" should be split into "remote SERVER" and "port NNNN".

  • 2
    I can confirm that removing the comments from the .ovpn file resolved my issue. – George D Oct 31 '16 at 10:22
$ sudo openvpn --config file.ovpn

worked for me - I can tunnel, however I need to remember local IPs since I have no local DNS configured.


Try adding it through the terminal instead of through the GUI:

sudo nmcli connection import type openvpn file your-file.ovpn

As stated on https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/606365

PS: You might still need to tweak your .ovpn with the tips found on other answers on this question nevertheless.

  • No Need to change anything on the config file; it is saved my time – Abu Sayem Mar 20 '20 at 5:07

Edit *.ovpn file

Probably this is caused by settings in the .opvn file that can't be parsed.

First make sure you have the needed packages installed:

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

If it still fails, edit the *.ovpn file in a text editor and strip out the following lines that break the import.

<he> tag

If there is a <he> tag in the client ovpn config files, delete those lines. It's not needed:


Multiple connection details

If there is something like:

remote <ip> 443 tcp-client
remote <ip> 1194 udp

Replace that section with this:

remote <ip> 1194 udp

The import stumbles upon multiple connections and doesn't support the <connection> tag. At least not in 16.04-17.04.

That's all, IMHO you can keep comments, they make no difference.

After you deleted the tag and edited the connection part, try to import the modified *.ovpn file. Solution from this blog post.


For me, I had to change the following in the .ovpn file:

remote ***.org 443 tcp-client


proto tcp
remote ***.org 443

And also, as pointed by @Kostas Filios I had to change this part to a comment:

#reneg-sec 2592000

I had this problem while importing the .ovpn file with the network manager. I fixed it by changing my remote line from

remote vpn.example.com 1190 udp4


remote vpn.example.com 1190 udp


I had the same problem on a fresh Ubuntu 18.04 install. To my surprise openVPN was NOT installed by default.

I figured out because when I clicked "+" sign in "setting->Network->VPN"section the dialogue box did only had two option i.e. Open VPN option was not there.

I followed 1 and installed openvpn and restarted network manager everything worked fine after that as I can see the OpenVPN option on the popup image attached

sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome
sudo systemctl restart network-manager

Joao Paulo's advice


I needed to replace the line remote xx.xx.xx.xx 443 tcp4 with remote xx.xx.xx.xx 443 tcp for it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.