Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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:

AUTOSTART="VYPRVPN"

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

1 Answer 1

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

 
discard

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.