Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using OpenVPN on Ubuntu 12.04 LTS. I've set up OpenVPN to connect to my vpn service. It works great. Now, I need it to connect automatically.

I can run from a terminal

nmcli con up uuid 334464e5-5d0d-40f3-a4db-d41ca7e2929d

and it works great.

I'd like to make it connect when the system starts. I added that command as a startup program, but still doesn't connect.

I edited /etc/default/openvpn as well. I added this line:


Still no joy.

From the logs:

Jan  2 23:11:19 ubuntu12-virtual-machine NetworkManager[1023]: <info> VPN service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 2241
Jan  2 23:11:19 ubuntu12-virtual-machine NetworkManager[1023]: <info> VPN service 'openvpn' appeared; activating connections
Jan  2 23:11:19 ubuntu12-virtual-machine NetworkManager[1023]: <error> [1388725879.294774] [nm-vpn-connection.c:934] get_secrets_cb(): Failed to request VPN secrets #2: (6) No agents were available for this request.
Jan  2 23:11:24 ubuntu12-virtual-machine NetworkManager[1023]: <info> VPN service 'openvpn' disappeared

VPN Secrets? Help?

share|improve this question

2 Answers 2

When you set up your VPN connection through the GUI the password is saved in the key-ring. If you save your password in the connection file, like this:

sudo nano /etc/NetworkManager/system-connections/MyConnectionExampleName

in this file:

    # 1 here means key-ring I  think, but with 0, the password below is  used

share|improve this answer

As the log has shown, it has tried to connect at startup and failed. It seems that your secret is stored in an authentication agent, which maybe starts later than OpenVPN. NetworkManager uses authentication agent provided by X session, but it starts very late.

You may find "Store connection secrets" in NetworkManager settings, choose "In a file" instead of "In secure storage", so that OpenVPN could find the secret by itself.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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