netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
11.18k stars 515 forks source link

Windows: The process cannot access the file because it's being used by another process. Netbird and Wireguard cannot exist on the same machine. #1923

Closed MxD-js closed 6 months ago

MxD-js commented 6 months ago

Describe the problem I have wireguard already installed on my windows machine to connect to another wireguard server and I need to disconnect from wireguard server in order to use netbird. Or if I have wireguard connect and I try to connect netbird, no error appears but netbird cannot connect until I disconnect from wireguard server. So appears that only 1 wireguard connection can be active at anytime. I suspect netbird uses 51820 port just like wireguard does.

I also tried the same on Ubuntu server. I have wireguard set up as a server that the above windows machine connects to and when I tried to install netbird, even though netbird service is running, and the peer got added into the netbird dashboard the peer never connects. So same issue is what it appears like the windows set up above where only 1 wireguard connection per machine.

To Reproduce

Steps to reproduce the behavior: 1) Install wireguard https://www.wireguard.com and connect to a wireguard server, then try to connect netbird. You;ll notice it won't connect.

  1. Then try disconnecting from the wireguard server then connect netbird (connection will succeed) then try connecting to the wireguard server and you will get this error. image

This is what shows up in the wireguard logs. image

Expected behavior

Expect that wireguard and netbird to exist on the same machine and able to connect to netbird and wireguard server at the same time, perhaps netbird can be configured with a different wireguard port #.

Are you using NetBird Cloud?

no

NetBird version

v0.27.4

NetBird status -d output:


PS C:\Users\MD> netbird status -d output
Peers detail:
OS: windows/amd64
Daemon version: 0.27.4
CLI version: 0.27.4
Management: Disconnected, reason: up wg interface: listen udp4 :51820: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Signal: Disconnected, reason: up wg interface: listen udp4 :51820: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Relays:
  [stun:netbird.[mydomain.com]:3478] is Available
  [turn:netbird.[mydomain.com]:3478?transport=udp] is Available
Nameservers:
FQDN:
NetBird IP: N/A
Interface type: N/A
Quantum resistance: false
Routes: -
Peers count: 0/0 Connected
lixmal commented 6 months ago

Can you try changing the port with the netbird up command? https://docs.netbird.io/how-to/cli#up

MxD-js commented 6 months ago

Yep, that worked. changed it to 51821 and worked as expected on windows and linux. This can be closed now.

netbird up --management-url https://netbird.domain.com --wireguard-port 51821

and both machines connected.