Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to create API socket when /var/lib/wireguard does not exist #389

Open
foxx opened this issue Jan 21, 2024 · 0 comments
Open

Fails to create API socket when /var/lib/wireguard does not exist #389

foxx opened this issue Jan 21, 2024 · 0 comments

Comments

@foxx
Copy link

foxx commented Jan 21, 2024

This fails to work without sudo, or unless you prepare the wireguard socket dir manually. Ideally this directory would also be a configurable, which could live in userspace.

$ ls -lah /var/run/wireguard/
ls: cannot access '/var/run/wireguard/': No such file or directory

(wg-EWQAmZez) admin@uk3-ph-inf-netjoin-1:~/wg$ ~/.cargo/bin/boringtun-cli -l info -f lol
  2024-01-21T12:03:33.061427Z ERROR boringtun_cli: Failed to initialize tunnel, error: ApiSocket(Os { code: 2, kind: NotFound, message: "No such file or directory" })
    at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-cli-0.6.0/src/main.rs:160

$ sudo mkdir  /var/run/wireguard/

$ ~/.cargo/bin/boringtun-cli -v trace -f lol
  2024-01-21T12:06:39.473411Z ERROR boringtun_cli: Failed to initialize tunnel, error: ApiSocket(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })
    at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-cli-0.6.0/src/main.rs:160

$ sudo chown -R root /var/run/wireguard/
$ sudo chown -R root:root /var/run/wireguard/
$ sudo chmod -R 777 /var/run/wireguard/

$ ~/.cargo/bin/boringtun-cli -v trace -f lol
  2024-01-21T12:08:05.658893Z  INFO boringtun_cli: BoringTun started successfully
    at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-cli-0.6.0/src/main.rs:178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant