Open VPN setup on Ubuntu 22.05 with several errors - not working

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
ome90
OpenVpn Newbie
Posts: 1
Joined: Wed Oct 19, 2022 5:54 am

Open VPN setup on Ubuntu 22.05 with several errors - not working

Post by ome90 » Wed Oct 19, 2022 6:03 am

Hi! I am a beginner Linux user and still learning things.

The tutorial I followed: https://ubuntu.com/server/docs/service-openvpn

Everthing went fine until the first issue I encountered: There was an issue with gzip (I dont understand it and tried to just not use it)

Code: Select all

root@ometotchtli90-MS-7895:~# sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf /etc/openvpn/myserver.conf.gz
root@ometotchtli90-MS-7895:~# sudo gzip -d /etc/openvpn/myserver.conf.gz

gzip: /etc/openvpn/myserver.conf.gz: not in gzip format
root@ometotchtli90-MS-7895:~# sudo rm /etc/openvpn/myserver.conf.gz
root@ometotchtli90-MS-7895:~# sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf /etc/openvpn/myserver.conf
Next issue I had were these errors when using gedit - but I could save the changes anyway.

Code: Select all

root@ometotchtli90-MS-7895:~# gedit /etc/openvpn/myserver.conf

(gedit:10052): dconf-WARNING **: 15:53:21.549: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

** (gedit:10052): WARNING **: 15:55:14.567: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported
Next issue I ran into was this one. I did not use --secret as advised. Had the same error as above when using gedit again.

Code: Select all

root@ometotchtli90-MS-7895:~# sudo openvpn --genkey --secret ta.key
2022-10-15 15:56:04 WARNING: Using --genkey --secret filename is DEPRECATED.  Use --genkey secret filename instead.
root@ometotchtli90-MS-7895:~# sudo openvpn --genkey secret ta.key
root@ometotchtli90-MS-7895:~# gedit /etc/sysctl.conf

(gedit:10156): dconf-WARNING **: 15:56:51.883: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

** (gedit:10156): WARNING **: 15:57:22.916: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported
then I finished the setup, but it doesnt work. You can see the entire log here:

Code: Select all

root@ometotchtli90-MS-7895:~# sudo sysctl -p /etc/sysctl.conf
net.ipv4.ip_forward = 1
root@ometotchtli90-MS-7895:~# sudo systemctl start openvpn@myserver
Job for openvpn@myserver.service failed because the control process exited with error code.
See "systemctl status openvpn@myserver.service" and "journalctl -xeu openvpn@myserver.service" for details.
root@ometotchtli90-MS-7895:~# sudo journalctl -u openvpn@myserver -xe
Thank you for reading and considering helping me out here!

User avatar
ordex
OpenVPN Inc.
Posts: 444
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: Open VPN setup on Ubuntu 22.05 with several errors - not working

Post by ordex » Wed Oct 19, 2022 6:37 am

The error is here:

Code: Select all

Oct 15 15:58:51 ometotchtli90-MS-7895 ovpn-myserver[10243]: Cannot pre-load keyfile (ta.key)
Your config file expects the ta.key to be in a certain folder, but you probably placed it somewhere else.
I would suggest you to start reading some howto from www.openvpn.net in order to understand how to get started with a server.

Post Reply