53

I've imported an OpenVPN configuration file that behaves differently when trying to connect from Network Manager and command line. I would like to see what the imported configuration file looks like.

Oxwivi
  • 18,559

3 Answers3

82

12.04 onwards

Connection information is stored in the directory:

/etc/NetworkManager/system-connections

Note: This directory stores other connection information such as wifi connections.

Pre 12.04

In Kubuntu, network-manager-openvpn-kde saves its profiles to:

~/.kde/share/apps/networkmanagement/connections/

In Ubuntu, network-manager-openvpn-gnome saves its profiles to:

~/.gconf/system/networking/connections/

(VPN settings are in ~/.gconf/system/networking/connections/*/vpn/%gconf.xml)

KrisWebDev
  • 1,690
Lekensteyn
  • 178,864
  • 2
    Isn't there a way to have it directly use .conf files? – Oxwivi Mar 05 '11 at 12:48
  • 2
    There is, but it circumvents the network-manager. Place the file in /etc/openvpn/. Make sure it has a .conf suffix, the init script at /etc/init.d/openvpn searches for such files. The VPN will be started at boot time. To disable this, edit /etc/default/openvpn uncomment the AUTOSTART=none line. I'm doing it this way because the network-manager-openvpn is too limited, I cannot run script after connection for example. To start OpenVPN with your configuration file client.conf, run sudo /etc/init.d/openvpn start client. To stop it, run /etc/init.d/openvpn stop client. – Lekensteyn Mar 05 '11 at 13:11
  • 4
    It seems this answer is no longer up-to-date as of Ubuntu 12.04. I have a couple VPNs configured through Network Manager in 12.04 using network-manager-openvpn-gnome, but there is no ~/.gconf/system directory. Anyone know where those files might live nowadays? – Carl Meyer May 02 '12 at 15:44
  • @CarlMeyer Try importing and run the command find ~ -mmin -3 -ls to find all modified files in the last 3 minutes. – Lekensteyn May 02 '12 at 15:47
  • I found a whole slew of files modified, but none of them look like openvpn kind of things. – boatcoder Jun 22 '12 at 22:30
  • 6
    Turns out they are stored in /etc/NetworkManager/system-connections/ (even when they aren't shared with everyone) – boatcoder Jun 22 '12 at 22:36
  • Can a file just be added to /etc/NetworkManager/system-connections/, or are there other places where this data is redundantly stored? – snapfractalpop Apr 09 '15 at 15:49
  • @snapfractalpop Network Manager reads network profiles from /etc/NetworkManager/ only. Though there are other locations where network information can be stored (such as /etc/network/), or /etc/sysconfig/ depending on the loaded plugins in /etc/NetworkManager/NetworkManager.conf (see the manual page of NetworkManager.conf). – Lekensteyn Apr 10 '15 at 13:18
  • This answer seems to be wrong in Uburnu 23.10. The file is not at any of these locations. – foobar Mar 01 '24 at 06:55
  • 2
    Thirteen years later, an upgrade to Ubuntu 24.04 will silently convert all NetworkManager configurations to netplan which reside in /etc/netplan/. – Hermann Sep 17 '24 at 18:41
7

In Ubuntu 24.04 you can find the network configurations (including vpn configurations) in /etc/netplan

  • 1
    This is important to know; the previous answers are outdated, and not helpful anymore. – foo Apr 21 '25 at 12:10
6

Yes, in Ubuntu 12.04 and later the config settings are stored in /etc/NetworkManager/system-connections -- except, when someone didn't migrate the connection information out of an older .conf file and continued using that .conf file instead. In that case, the settings are in /home/USER/.gcm/gcm.conf

Reese
  • 111