How to setup VPN using an .ovpn file? [duplicate]

I've been using Ubuntu 18.04 for about 3 days now and so far it runs smoothly. I now need to install a VPN for my work, and I got the following files from the sysadmin:

  • ca.crt
  • VPNConfig.ovpn

I first ran sudo apt install openvpn. After that I wanted to install it using the GUI. So I went to the settings app and under "Network" I tried adding a new VPN. It gives the option to "Import from a file". So I selected the VPNConfig.ovpn file, but it says it can't import the file. I also tried importing the ca.crt file and importing the zip in which the two files came, but that didn't work either.

Could anybody help me out as to how I can make this VPN work?


You have to install a few packages first with:

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

then, restart network-manager

sudo service network-manager restart

and try again. If it doesn't work, then try logging out and back in, if not, then try rebooting.