Systemctl start wg-quick@wg0.service doesn't turn on and throws an error

Hi all! After I installed wireguard using the yay -S wireguard-tools command, connected the tunnel to the server using the sudo nano /etc/wireguard/wg0-client.conf (entered all the necessary data) and wg-quick up wg0-client commands, I want to start the wireguard service with the systemctl start wg-quick@wg0.service command, but after I write this command and enter the password, I get an error:

Job for wg-quick@wg0.service failed because the control process exited with error code.
See "systemctl status wg-quick@wg0.service" and "journalctl -xeu wg-quick@wg0.service" for details.

Here is what the systemctl status wg-quick@wg0.service command shows:

× wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
     Loaded: loaded (/usr/lib/systemd/system/wg-quick@.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2023-02-04 05:14:00 CST; 2min 16s ago
       Docs: man:wg-quick(8)
             man:wg(8)
             https://www.wireguard.com/
             https://www.wireguard.com/quickstart/
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
    Process: 10083 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=1/FAILURE)
   Main PID: 10083 (code=exited, status=1/FAILURE)
        CPU: 10ms

Feb 04 05:14:00 flag systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Feb 04 05:14:00 flag wg-quick[10083]: wg-quick: `/etc/wireguard/wg0.conf' does not exist
Feb 04 05:14:00 flag systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/>
Feb 04 05:14:00 flag systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
Feb 04 05:14:00 flag systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

Here is what the command journalctl -xeu wg-quick@wg0.service shows:

░░ A start job for unit wg-quick@wg0.service has begun execution.
░░ 
░░ The job identifier is 3497.
Feb 04 05:14:00 flag wg-quick[10083]: wg-quick: `/etc/wireguard/wg0.conf' does not exist
Feb 04 05:14:00 flag systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit wg-quick@wg0.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 04 05:14:00 flag systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit wg-quick@wg0.service has entered the 'failed' state with result 'exit-code'.
Feb 04 05:14:00 flag systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.
░░ Subject: A start job for unit wg-quick@wg0.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit wg-quick@wg0.service has finished with a failure.
░░ 
░░ The job identifier is 3497 and the job result is failed.
Feb 04 05:23:37 flag systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
░░ Subject: A start job for unit wg-quick@wg0.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit wg-quick@wg0.service has begun execution.
░░ 
░░ The job identifier is 3602.
Feb 04 05:23:37 flag wg-quick[11172]: wg-quick: `/etc/wireguard/wg0.conf' does not exist
Feb 04 05:23:37 flag systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit wg-quick@wg0.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 04 05:23:37 flag systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit wg-quick@wg0.service has entered the 'failed' state with result 'exit-code'.
Feb 04 05:23:37 flag systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.
░░ Subject: A start job for unit wg-quick@wg0.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit wg-quick@wg0.service has finished with a failure.
░░ 
░░ The job identifier is 3602 and the job result is failed.

However, the wg-quick up wg0-client command works without any errors, and hence the vpn itself works.

You need to set up /etc/wireguard/*interfacename*.conf to use wg-quick, even if you have included that information elsewhere in other configuration files. This part of the ArchWiki article describes how to set it up: https://wiki.archlinux.org/title/WireGuard#Persistent_configuration

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.