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.11k stars 512 forks source link

Cannot start netbird on Windows 10 #1107

Open rgl opened 1 year ago

rgl commented 1 year ago

Describe the problem

For some reason that I would like help with, netbird in not starting on one of my machines.

To Reproduce

Steps to reproduce the behavior:

  1. Just try to start netbird.

Expected behavior

Maybe it should have logged more detail about wguser: errno=-98?

NetBird status -d output:

# netbird status -d
Peers detail:
Daemon version:
CLI version: 0.22.7
Management: Disconnected
Signal: Disconnected
FQDN:
NetBird IP: N/A
Interface type: N/A
Peers count: 0/0 Connected
# netbird service stop
Netbird service has been stopped

# netbird up -F --log-level debug
2023-08-25T08:25:41+01:00 DEBG client/internal/login.go:93: connecting to the Management service https://api.wiretrustee.com:443
2023-08-25T08:25:41+01:00 DEBG client/internal/login.go:63: connected to the Management service https://api.wiretrustee.com:443
2023-08-25T08:25:41+01:00 DEBG client/internal/login.go:93: connecting to the Management service https://api.wiretrustee.com:443
2023-08-25T08:25:41+01:00 DEBG client/internal/login.go:63: connected to the Management service https://api.wiretrustee.com:443
2023-08-25T08:25:41+01:00 DEBG client/internal/connect.go:99: conecting to the Management service api.wiretrustee.com:443
2023-08-25T08:25:42+01:00 DEBG client/internal/connect.go:107: connected to the Management service api.wiretrustee.com:443
2023-08-25T08:25:42+01:00 DEBG signal/client/grpc.go:91: connected to Signal Service: signal2.wiretrustee.com:443
2023-08-25T08:25:42+01:00 ERRO client/internal/routemanager/manager.go:41: server router is not supported: firewall not supported on this OS
2023/08/25 08:25:42 Using existing driver 0.14
2023/08/25 08:25:42 Creating adapter
2023-08-25T08:25:42+01:00 DEBG iface/tun_windows.go:108: UAPI listener started
2023-08-25T08:25:42+01:00 DEBG iface/tun_windows.go:164: adding address 100.71.22.239 to interface: wt0
2023-08-25T08:25:42+01:00 DEBG iface/iface.go:54: configuring Wireguard interface wt0
2023-08-25T08:25:42+01:00 DEBG iface/wg_configurer_nonandroid.go:26: adding Wireguard private key
2023-08-25T08:25:42+01:00 DEBG iface/tun_windows.go:103: exit tunDevice.IpcHandle
2023-08-25T08:25:42+01:00 ERRO client/internal/engine.go:236: failed configuring Wireguard interface [wt0]: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820
2023-08-25T08:25:42+01:00 DEBG client/internal/engine.go:1016: removing Netbird interface wt0
2023-08-25T08:25:42+01:00 DEBG iface/tun_windows.go:103: exit tunDevice.IpcHandle
2023-08-25T08:25:42+01:00 ERRO client/internal/connect.go:175: error while starting Netbird Connection Engine: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820
2023-08-25T08:25:44+01:00 DEBG client/internal/connect.go:99: conecting to the Management service api.wiretrustee.com:443
2023-08-25T08:25:44+01:00 DEBG client/internal/connect.go:107: connected to the Management service api.wiretrustee.com:443
2023-08-25T08:25:44+01:00 DEBG signal/client/grpc.go:91: connected to Signal Service: signal2.wiretrustee.com:443
2023-08-25T08:25:44+01:00 ERRO client/internal/routemanager/manager.go:41: server router is not supported: firewall not supported on this OS
2023/08/25 08:25:44 Using existing driver 0.14
2023/08/25 08:25:44 Creating adapter
pappz commented 1 year ago

@rgl Maybe the default Wireguard port is in use. Do you have any other application what can take that port?

rgl commented 1 year ago

@pappz there's nothing listening at that port:

# netstat -an | grep 51820
teoder commented 1 year ago

I'm having the same problem on Win11 with Netbird v0.24.0 and earlier versions too, reboot of PC solves the issue. I haven't found a solution without rebooting.

2023-10-25T14:01:41+02:00 ERRO client/internal/engine.go:236: failed configuring Wireguard interface [wt0]: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820 2023-10-25T14:01:41+02:00 ERRO client/internal/connect.go:175: error while starting Netbird Connection Engine: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820 2023-10-25T14:01:42+02:00 ERRO client/internal/routemanager/manager.go:41: server router is not supported: firewall not supported on windows

When checking netstat I have no process or service that are locking 51820.

mlsmaycon commented 1 year ago

Hello @teoder , what is your operating system language? we are investigating this issue now https://github.com/netbirdio/netbird/issues/1249

teoder commented 1 year ago

Hello @teoder , what is your operating system language? we are investigating this issue now #1249

OS Name: Microsoft Windows 11 Business OS Version: 10.0.22621 N/A Build 22621

Fantu commented 1 year ago

@teoder this is the version but not the language, needed to understand if is the same issue reported in #1249 excluding the additional language pack (possibly added later for user interfaces) in which language was windows installed?

mlsmaycon commented 1 year ago

The firewall logs are misleading in this case. @teoder @rgl Can you confirm that when the issue happens, you have no other wt0 interface in the system?

teoder commented 1 year ago

I'm using an English version. Right now I have no issues, but I'll post as soon as it happens again.

teoder commented 1 year ago

@mlsmaycon Right now I'm having issues related to this (I think) Getting these messages wen running Netbird v0.24.2 with "netbird up -F"

2023/10/30 14:24:16 Creating adapter 2023-10-30T14:24:16+01:00 ERRO client/internal/engine.go:229: failed creating tunnel interface wt0: [open \\.\pipe\ProtectedPrefix\Administrators\WireGuard\wt0: This security ID may not be assigned as the owner of this object.] 2023-10-30T14:24:16+01:00 ERRO client/internal/connect.go:178: error while starting Netbird Connection Engine: open \\.\pipe\ProtectedPrefix\Administrators\WireGuard\wt0: This security ID may not be assigned as the owner of this object. 2023-10-30T14:24:25+01:00 ERRO client/internal/routemanager/manager.go:41: server router is not supported: firewall not supported on windows 2023/10/30 14:24:25 Using existing driver 0.14

No other software using wt0, it's non-existent.

mlsmaycon commented 1 year ago

Hello @teoder there is no support for running NetBird in the foreground without a system account. That's why you should run it as a service only or with a tool called PSexec, which can be installed using chocolatey:

choco install -y sysinternals
PsExec64 -s netbird up -F -l debug
teoder commented 1 year ago

Hello @teoder there is no support for running NetBird in the foreground without a system account. That's why you should run it as a service only or with a tool called PSexec, which can be installed using chocolatey:

choco install -y sysinternals
PsExec64 -s netbird up -F -l debug

Thanks, that explained a lot! I was testing it out all wrong. I Still have issues, but not related to this :)

rgl commented 10 months ago

@mlsmaycon, I confirm that I do not have any interface named wt0. Netbird sits in a loop doing:

2023-12-19T16:54:47Z DEBG client/internal/login.go:93: connecting to the Management service https://api.wiretrustee.com:443
2023-12-19T16:54:48Z DEBG client/internal/login.go:63: connected to the Management service https://api.wiretrustee.com:443
2023-12-19T16:54:48Z DEBG client/internal/login.go:93: connecting to the Management service https://api.wiretrustee.com:443
2023-12-19T16:54:48Z DEBG client/internal/login.go:63: connected to the Management service https://api.wiretrustee.com:443
2023-12-19T16:54:48Z INFO client/internal/connect.go:56: starting NetBird client version 0.25.0
2023-12-19T16:54:48Z DEBG client/internal/connect.go:111: connecting to the Management service api.wiretrustee.com:443
2023-12-19T16:54:48Z DEBG client/internal/connect.go:119: connected to the Management service api.wiretrustee.com:443
2023-12-19T16:54:48Z DEBG signal/client/grpc.go:91: connected to Signal Service: signal.netbird.io:443
2023/12/19 16:54:48 Using existing driver 0.14
2023/12/19 16:54:48 Creating adapter
2023-12-19T16:54:49Z DEBG iface/tun_windows.go:108: UAPI listener started
2023-12-19T16:54:49Z DEBG iface/tun_windows.go:164: adding address 100.71.22.239 to interface: wt0
2023-12-19T16:54:49Z DEBG iface/iface.go:54: configuring Wireguard interface wt0
2023-12-19T16:54:49Z DEBG iface/wg_configurer_nonmobile.go:26: adding Wireguard private key
2023-12-19T16:54:49Z DEBG iface/tun_windows.go:103: exit tunDevice.IpcHandle
2023-12-19T16:54:49Z ERRO client/internal/engine.go:262: failed configuring Wireguard interface [wt0]: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820
2023-12-19T16:54:49Z DEBG client/internal/engine.go:1037: removing Netbird interface wt0
2023-12-19T16:54:49Z DEBG iface/tun_windows.go:103: exit tunDevice.IpcHandle
2023-12-19T16:54:49Z ERRO client/internal/connect.go:187: error while starting Netbird Connection Engine: received error "read: wguser: errno=-98" while configuring interface wt0 with port 51820
2023-12-19T16:54:49Z DEBG client/internal/connect.go:111: connecting to the Management service api.wiretrustee.com:443
2023-12-19T16:54:49Z DEBG client/internal/connect.go:119: connected to the Management service api.wiretrustee.com:443
2023-12-19T16:54:52Z DEBG signal/client/grpc.go:91: connected to Signal Service: signal.netbird.io:443
2023/12/19 16:54:52 Using existing driver 0.14
2023/12/19 16:54:52 Creating adapter