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

Closed
opened 2025-11-20 05:18:32 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @MxD-js on GitHub (May 5, 2024).

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

Originally created by @MxD-js on GitHub (May 5, 2024). **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. 2. 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](https://github.com/netbirdio/netbird/assets/60336163/b735efe9-b211-4860-baf1-5daf653f60e2) This is what shows up in the wireguard logs. ![image](https://github.com/netbirdio/netbird/assets/60336163/582bfb44-c641-4d44-a15b-ea5bbf1e3212) **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
saavagebueno added the triage-needed label 2025-11-20 05:18:32 -05:00
Author
Owner

@lixmal commented on GitHub (May 6, 2024):

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

@lixmal commented on GitHub (May 6, 2024): Can you try changing the port with the `netbird up` command? https://docs.netbird.io/how-to/cli#up
Author
Owner

@MxD-js commented on GitHub (May 6, 2024):

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.

@MxD-js commented on GitHub (May 6, 2024): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#846