I have a .ovpn file, but I don’t know how to connect to it on NixOS. Initially, I wanted to use PPTP, as the networkmanager-pptp package was available on Arch, but I checked and it is not available on NixOS, so I can’t connect using that method.
Now, I need guidance on how to connect to the .ovpn file, which is for OpenVPN, on NixOS. I’ve imported the file into NetworkManager, but it keeps showing “connecting…” and never connects.
If you have any solutions, whether for PPTP or OpenVPN, I would appreciate your help. My goal is simply to get it working.
Thanks for your guidance, but this seems to be like adding it manually via the UI, just like before. It gets added, but the problem persists; it just shows "connecting. " Here are the logs I got:
amir@nixos ~/Downloads> journalctl -u NetworkManager
May 23 14:17:33 nixos systemd[1]: Starting Network Manager...
May 23 14:17:34 nixos systemd[1]: Started Network Manager.
May 23 14:29:26 nixos systemd[1]: Stopping Network Manager...
May 23 14:29:26 nixos NetworkManager[1135]: <warn> [1747997966.2291] dispatcher: (9) failed (after 0.001 sec>
May 23 14:29:26 nixos systemd[1]: NetworkManager.service: Deactivated successfully.
May 23 14:29:26 nixos systemd[1]: Stopped Network Manager.
May 23 14:29:26 nixos systemd[1]: NetworkManager.service: Consumed 606ms CPU time, 21.1M memory peak, 11.5M r>
-- Boot 877234002b2049f5a0d086f5d494618b --
May 23 14:29:54 nixos systemd[1]: Starting Network Manager...
May 23 14:29:55 nixos systemd[1]: Started Network Manager.
May 23 14:30:03 nixos NetworkManager[1183]: <warn> [1747998003.0868] device (wlo1): no secrets: No agents we>
May 23 14:30:03 nixos NetworkManager[1183]: <warn> [1747998003.0869] device (wlo1): Activation: failed for c>
May 24 14:34:32 nixos systemd[1]: Stopping Network Manager...
May 24 14:34:32 nixos NetworkManager[1183]: <warn> [1747998272.3809] dispatcher: (9) failed (after 0.000 sec>
May 24 14:34:32 nixos systemd[1]: NetworkManager.service: Deactivated successfully.
May 24 14:34:32 nixos systemd[1]: Stopped Network Manager.
May 24 14:34:32 nixos systemd[1]: NetworkManager.service: Consumed 288ms CPU time, 21.1M memory peak, 11.6M r>
-- Boot fd4bf67596184ffd8cddbdaa49a01810 --
May 24 14:34:49 nixos systemd[1]: Starting Network Manager...
May 24 14:34:50 nixos systemd[1]: Started Network Manager.
May 24 14:34:58 nixos NetworkManager[1122]: <warn> [1747998298.3064] device (wlo1): no secrets: No agents we>
May 24 14:34:58 nixos NetworkManager[1122]: <warn> [1747998298.3066] device (wlo1): Activation: failed for c>
May 24 14:40:17 nixos systemd[1]: Stopping Network Manager...
May 24 14:40:17 nixos NetworkManager[1122]: <warn> [1747998617.0724] dispatcher: (9) failed (after 0.001 sec>
May 24 14:40:17 nixos systemd[1]: NetworkManager.service: Deactivated successfully.
May 24 14:40:17 nixos systemd[1]: Stopped Network Manager.
May 24 14:40:17 nixos systemd[1]: NetworkManager.service: Consumed 241ms CPU time, 21.5M memory peak, 11.6M r>
```"
Thank you for your time. Unfortunately, this also didn’t work for me. Is there a way to enable PPTP for NetworkManager in NixOS? It worked on EndeavourOS, and I really need it.
Are you running nm-applet or some other secrets manager? How are you activating the connection? What happens if you do
nmcli conn up $vpn
what happens if you do
nmcli conn up --ask $vpn
where $vpn is the name assigned to your vpn connection.
nmcli conn show
will list your connections if you don’t know the name.
I am basing this off
May 24 14:34:58 nixos NetworkManager[1122]: <warn> [1747998298.3064] device (wlo1): no secrets: No agents we>
because the rest of the line is No agents were available for this request, typically generated ovpn file do not have the password in them. Please setup your pager to wrap, or disable the pager when providing logs (man journalctl for pager settings). You did not increase the logging verbosity either. It would be helpful if you did this.
The logs are useless because they are all cut off. Please fix your pager or switch it off.
journalctl --no-pager -u NetworkManager -b
for instance. You can trim to some time range using --since--before. Please increase the log level. Honestly, I’m not sure I can help you here, because I don’t think I have the patience to get to the bottom of this.
Hey bro, thanks a lot for all your help so far. Just give me one last lead to figure out where the issue is. It’s highly unlikely to be a NixOS-specific problem, so if I just get a hint, I’ll follow up on it myself. Really appreciate your efforts!
Here’s my log:
Jun 11 20:56:33 nixos nm-openvpn[3122]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jun 11 20:56:33 nixos nm-openvpn[3122]: TCP/UDP: Preserving recently used remote address: [AF_INET]192.168.50.50:443
Jun 11 20:56:33 nixos nm-openvpn[3122]: Attempting to establish TCP connection with [AF_INET]192.168.50.50:443
Jun 11 20:56:33 nixos nm-openvpn[3122]: TCP connection established with [AF_INET]192.168.50.50:443
Jun 11 20:56:33 nixos nm-openvpn[3122]: TCPv4_CLIENT link local: (not bound)
Jun 11 20:56:33 nixos nm-openvpn[3122]: TCPv4_CLIENT link remote: [AF_INET]192.168.50.50:443
Jun 11 20:56:34 nixos nm-openvpn[3122]: Connection reset, restarting [0]
Jun 11 20:56:34 nixos nm-openvpn[3122]: SIGUSR1[soft,connection-reset] received, process restarting