micahmo / wgserverforwindows Goto Github PK
View Code? Open in Web Editor NEWWg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
License: MIT License
Wg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
License: MIT License
I like this project very much, but when I installed it on my work PC recently, it kept saying that the .net core component was missing. What puzzled me was that the software did not indicate what version of the net component was missing. I tried to download several versions on the web, but it didn't work.
The pop-up window prompts "would you like to download...", I click yes, and no browser window pops up.
May I ask which version of .net core components do I need to install?
I have v2.0.5 and it works great except for after the computer restarts. NAT Routing always stays disabled until I start up WS4W and click enable again. I don't see anything under services about starting up automatically - what would the command be to start NAT routing so that I could add it in manually as an Automatic (Delayed) start service?
Steps I did WireGuard Server For Windows in VPS
1.successfully run all requests
https://ibb.co/Fz1vmZf
2.
Infor Server Configuration https://ibb.co/bbH36sD
Export Configuration File => vpnFile.conf https://ibb.co/CWZ5bgr
3.I opened port 51820 on Firewall
4.Use vpnFile.conf on another computer
https://ibb.co/zmrw5sz
5.Wireguard always notices on the log "invalid MAC of handshake, dropping packet from"
https://ibb.co/HTsw1Ht
=>It makes my connected computer unable to access the network
=>I'm a newbie with no experience.I don't know what step I'm missing or where I'm going wrong. Please help me
Thank your work. I want to change public IP address by command. But I don't found app store configuration file. Where is configuration file?
When I try to activate internet sharing I have this error
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidCastException: Specified cast is not valid.
at NETCONLib.NetSharingManagerClass.get_INetSharingConfigurationForINetConnection(INetConnection pNetConnection)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.<>c__DisplayClass5_0.b__1(INetConnection n) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 62
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 60
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 51
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.InvalidCastException: Specified cast is not valid.
at NETCONLib.NetSharingManagerClass.get_INetSharingConfigurationForINetConnection(INetConnection pNetConnection)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.<>c__DisplayClass5_0.b__1(INetConnection n) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 62
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 60
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 51
Hi there,
Thanks for writing this GUI that massively simplifies setting up WireGuard properly.
However, there's one functionality in base WireGuard that I miss--as the server, I am still able to deactivate/exit the program, and that option is remembered on next startup. WG4W however is persistently on, restarting does not seem to shut the server off. Exiting the program does not kill the WG service running in the background.
My use case is that I want to run a temporary server to create an ad-hoc LAN with my mates, but I want to be able to stop it once the session is over, so that they don't connect to/through my network if they forget to deactivate the WG client on their end.
Could we get a button that remembers the activated/deactivated state of the server that hopefully persists through restarts? Cheers.
Maybe we increase the grouping function of the client management page.
Each client occupies a large part of the area. When there are many people, it will be very crowded. You can make each of them in a specific group, and you can also fold the configuration file information in the group. , expand it when you want to view it.
This will make managing the client a lot easier.
I've got 2 public IP addresses on my WAN interface. Wireguard listens on IP1, but when I enable NAT, and connect a client, outgoing IP addresses for clients are basically random, sometimes they get IP1, sometimes IP2.
Is it possible to enforce this, somehow, so that clients get same outgoing IP address as is the listening one?
Hi, from my iPhone I connected successfully with cell data to home windows wireguard:.
Here's server status:
interface: wg_server
public key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
private key: (hidden)
listening port: 51820
peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
preshared key: (hidden)
endpoint: 174.xx.xx.xx:13670
allowed ips: 10.253.0.2/32
latest handshake: 13 seconds ago
transfer: 38.24 KiB received, 6.50 KiB sent
But I cannot access internet or my home LAN from iPhone when connected to wireguard..
Any ideas?
Thank you!
Hi, it is my understanding, that usage of a Preshared Key in server and client configuration is optional in Wireguard.
But I can't try it, as WireGuardServerForWindows doesn't allow to setup configuration without Preshared Key.
It would be nice, if Preshared Key could be optional.
I am trying to install wireguard on windows server 2012 but when I want to create the tunnel the service cannot be started: WireGuard Tunnel: wg_server is there any way to fix it?
Maybe you could add a donation button somewhere here on github?
This project is epic!
First off let me thank you for making this application. I only found it yesterday but managed to get a WireGuard server running in under an hour.
Now onto the issue at hand.
In commit eb22d73 a support check for New-NetNat was introduced. This support check fails on my machine even though New-NetNat is supported. Running the support check in powershell yields the following output:
PS C:\WINDOWS\system32> Get-Help New-NetNat -Parameter InternalIPInterfaceAddressPrefix
Get-Help : Kein Parameter entspricht dem Kriterium "InternalIPInterfaceAddressPrefix".
In Zeile:1 Zeichen:1
+ Get-Help New-NetNat -Parameter InternalIPInterfaceAddressPrefix
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (System.Manageme...CommandHelpInfo:ProviderCommandHelpInfo) [Get-Help],
PSArgumentException
+ FullyQualifiedErrorId : NoParmsFound,Microsoft.PowerShell.Commands.GetHelpCommand
Get-Help fails to find information about the InternalIPInterfaceAddressPrefix parameter and gives an exit code other than 0. Running the commands to manually set up NAT routing works fine however and no errors occur. After rewriting the support check and letting it do the setup everything worked fine aswell. I have pushed my changes to https://github.com/Dola-Shuvi/WgServerforWindows/commit/41413db1a86a4dbde74a3cba317c761da64b4f8e for you to take a look at.
My Windows version is 22H2 (Build 19045.2130) and I installed everything except the Hyper-V-Hypervisor and the GUI manager in the add/remove Windows features menu.
The wg Networks may become public after reboot.
The task scheduler entry re-enables NAT Routing, but Private Network (sometimes?) needs to be re-enabled manually in the WS4W UI.
A simple solution would be to extend the WS4W CLI command to change the network to private, so the task scheduler call on reboot can do both: enable NAT routing and change network to private.
My pc have wifi and ethernet. I want to enable ICS for ethernet, but ICS is allways be enabled for wifi.
Is it my system's issue?
Error when specifying ipv6 of server configuration in the endpoint line
Greetings
Thank you for making WG4W. I can not get it to launch.
My setup
Edition Windows 10 Pro
Version 21H1
OS build 19043.1237
Experience Windows Feature Experience Pack 120.2212.3530.0
CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz 3.20 GH
RAM: 8GB
WinGuard - downloaded, install
WG4W - download portable, unzip, launch 'WireGuardServerForWindows.exe'
Installed the .Net Core when prompted
.NetCore gives install complete dialog box
Get error that .NetCore is not installed. I see it in the installed program list.
Did repair of .NetCore.
Launch WireGuardServerForWindows.exe, same error
Restart computer
Launch WireGuardServerForWindows.exe, same error
Any suggestions would be appreciated.
Thank you
It would be nice, if it would be possible to use an existing private key. Thank you!
Hi! Thanks for your hard work!
A reboot may still cause the the internet sharing to fail, even though the Internet Connection Sharing service is running, and the network interface indicates that it is sharing in Control Panel. Only unsharing and resharing can fix this.
Hello again! Would it be possible to have this as an option?
If this would complicate things, then it would just be convenient if there was a button somewhere in the app that would open the WS4W folder in AppData in order to access the config files quickly.
Thank you for taking the time to read my suggestions.
The wireguard docs say this:
DNS — a comma-separated list of IP (v4 or v6) addresses to be set as the interface’s DNS servers, or non-IP hostnames to be set as the interface’s DNS search domains. May be specified multiple times. Upon bringing the interface up, this runs ‘resolvconf -a tun.INTERFACE -m 0 -x‘ and upon bringing it down, this runs ‘resolvconf -d tun.INTERFACE‘. If these particular invocations of resolvconf(8) are undesirable, the PostUp and PostDown keys below may be used instead.
In the current platform, when I add a non-IP address to the "DNS Servers" list, it is invalid. To be honest, I think this behavior is fine. I think there should be an additional field for search domain(s) that, if filled, simply joins the entries as comma-separated values to the DNS line of the configuration.
Hello. I would like to make a suggestion about the application.
Would it be possible for us to still be able to enable the tunnel service even when both client folders (clients_data and clients_wg) are empty? The reason I am asking this is because, after I generate the config files, I don't want to keep them on the server machine. I only want each client to keep his config file (for security purposes).
Thank you.
Thank you for creating this wonder full repo, installation and configuration made extremely easy.
Surprisingly this VPN on Windows 10 is faster than on Ubuntu (virtual machine with same hardware etc).
One question, how do I go about limiting access to certain networks in my LAN? I assume via local firewall rules but am not sure.
-M
Hello again. So I observed that when you enable NAT routing, a task is created in task scheduler that executes the setnetipaddress using your app on system startup.
Since I am using a WiFi network, it takes a while until my WiFi adapter automatically connects to my WiFi network on system startup, so when the task is executed, there isn't a wireguard tunnel to receive the IP address and subnet mask. As a result, the clients do not have internet access.
This is an issue I had been having even when I was manually setting up wireguard in the past, so this isn't an issue with your app. Of course, an ethernet connection would solve this, but it is not possible for me at the moment.
As a workaround for this, I have created a custom task in task scheduler that runs a .bat file that waits a few seconds before setting the IP address in the wireguard tunnel at system startup.
I tried to delete the task that the application creates, but it seems to come back after every restart. Would it be possible to add a checkbox at the "NAT Routing" section, that would let us decide if we want the task?
Thank you for your time.
following the setup steps once NAT is enabled, I cannot enable internet sharing or persistent sharing, both buttons are greyed out. I can enable internet sharing manually by opening the network connections properties. reopening the Wg Server app shows sharing is enabled but not persistent.
I have gone into regedit and changed HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedAccess\EnableRebootPersistConnection from 0 to 1 and changed "Internet Connection Sharing" in services from manual to automatic. so far with a restart of windows it all seems to be working on a remote client, but the app still shows persistent sharing is disabled with the button greyed out.
This is on the most recent win 10 updates on 22H2. is there a manual setting I am missing or can the app be updated to allow the buttons to work?
Dear Micahmo,
I ever set the server and client connected successfully,but when I restart WS4W ,the internet sharing symbol would be "X" ,
I try to enable and reconnect the internet, but it will show an error message as the images display,
https://imgur.com/a/dnJBjXN
https://imgur.com/5MboKPa
Could you help me fix it?
thank you very much
Recently I found that once wireguard server's NAT is enable, I will not able to create a wi-fi hotspot with Internet access.
This service is made for hotspot and can only support one NAT instance, meaning that, you will not able to set up a Wi-Fi hotspot with Internet access because SharedAccess services has been occupied by wireguard server's NAT
However, with New-NetNat
command, you'll able to set up many NAT instances and keep wi-fi hotspot work.
hypervisorlaunchtype
to off
in bcdedit if you dont want to use hyper-v!)Disable Internet sharing first.
Then, open powershell with admin permission
# First, get your interface index of wg_server interface
Get-NetAdapter
# Give a IP to wg_server interface
New-NetIPAddress -IPAddress 172.22.0.1 -PrefixLength 24 -InterfaceIndex 68 # Your interface index here
New-NetNat -Name wgservernat -InternalIPInterfaceAddressPrefix 172.22.0.0/24 # Your NAT name and interface CIDR here
Get-NetNat #
For test purpose, you can disable SharedAccess service and will find that NAT is working still .
For more information, check this article
Please note New-NetIPAddress
should be executed every time you reboot
Hi !
thank you for sharing this source!
If I choose windows serve as the system of WgServerforWindows, then what minimum version of WinServer can I choose? According to my friend's test, he said that windows server2008R2 will prompt that the version is too low.
Is it maybe possible to minimize the normal Settings Window, but still let the Stats View open?
Right now, the "big" window cant be minimized.
Or is it maybe possible to add a Webserver with "webview" with more details?
something like this, but selfhosted.
https://www.procustodibus.com/images/blog/wireguard-monitoring/pro-custodibus-dashboard.png
https://www.procustodibus.com/images/blog/wireguard-monitoring/pro-custodibus-endpoint-history.png
Address propperty is not saved to output config.
So network interface address is not configured (169.254...).
without this line uncommented:
https://github.com/micahmo/WireGuardServerForWindows/blob/158c875bc089d3e61605a540b3edab9060595d72/WireGuardServerForWindows/Models/ServerConfiguration.cs#L21
server config in \AppData\Roaming\WS4W\server_wg\wg_server.conf
before:
# test
[Interface]
ListenPort=55555
PrivateKey=...
# client-test
[Peer]
PersistentKeepalive=0
PublicKey=...
PresharedKey=...
AllowedIPs=10.1.1.2/32
after uncomment:
# test
[Interface]
ListenPort=55555
Address=10.1.1.1/24
PrivateKey=...
# client-test
[Peer]
PersistentKeepalive=0
PublicKey=...
PresharedKey=...
AllowedIPs=10.1.1.2/32
Can anyone test/confirm this?
Hi Micah
Is there an easy way to migrate the existing running config to a new server without having to recreate every client.
Thanks
please give me full guide about port forwarding on wg server on windows
Hello,
i've no internet when my client is enabled...
server status:
`interface: wg_server
public key: eQqR5N/GnJgu+Yw8mRIDtZpublickey
private key: (hidden)
listening port: 51820
peer: v1RLoLK8Lynw9yvf20aHlN57ddApublickey
preshared key: (hidden)
endpoint: 192.168.1.254:55022
allowed ips: 10.253.0.3/32
latest handshake: 3 hours, 34 minutes ago
transfer: 18.27 KiB received, 301.00 KiB sent
persistent keepalive: every 25 seconds`
Im behing a freebox, port 51820 is opened
Firewall is off
for: endpoint: 192.168.1.254:55022
i've tryp iplan, ipwan and same
in client log:
2022-04-13 20:44:27.801: [TUN] [wg_server] Handshake for peer 1 (no address) did not complete after 5 seconds, retrying (try 12) 2022-04-13 20:44:27.801: [TUN] [wg_server] Sending handshake initiation to peer 1 (no address) 2022-04-13 20:44:28.817: [TUN] [wg_server] Handshake for peer 2 (192.168.1.254:55022) did not complete after 5 seconds, retrying (try 13) 2022-04-13 20:44:28.817: [TUN] [wg_server] Sending handshake initiation to peer 2 (192.168.1.254:55022) 2022-04-13 20:44:32.861: [TUN] [wg_server] Handshake for peer 1 (no address) did not complete after 5 seconds, retrying (try 13) 2022-04-13 20:44:32.861: [TUN] [wg_server] Sending handshake initiation to peer 1 (no address) 2022-04-13 20:44:33.907: [TUN] [wg_server] Handshake for peer 2 (192.168.1.254:55022) did not complete after 5 seconds, retrying (try 14) 2022-04-13 20:44:33.907: [TUN] [wg_server] Sending handshake initiation to peer 2 (192.168.1.254:55022)
edit: with latest update of windows 10, i can't enable internet sharing:
`System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException (0x80040201): Un événement n’a pu invoquer aucun des abonnés. (0x80040201)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 146
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 52
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.Runtime.InteropServices.COMException (0x80040201): Un événement n’a pu invoquer aucun des abonnés. (0x80040201)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 146
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 52
`
Hi,
"Allowed IPs" is a wireguard client configuration. At the moment is is set in "Server Configuration".
It may be nice to set it up once in "Server Configuration" but as a peer parameter it really should be in "Client Configuration". Maybe with a button "populate from server"?
This has fairly low priority, as "Allowed IPs" can be changed in the client software anyway, but it just looks ... "right" to be in "Client Configuration". ;)
Hello,
I can't enable internet sharing, when I click enable I get the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidCastException: Specified cast is not valid.
at NETCONLib.NetSharingManagerClass.get_INetSharingConfigurationForINetConnection(INetConnection pNetConnection)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.<>c__DisplayClass5_0.<Resolve>b__1(INetConnection n) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 62
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 60
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 51
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.InvalidCastException: Specified cast is not valid.
at NETCONLib.NetSharingManagerClass.get_INetSharingConfigurationForINetConnection(INetConnection pNetConnection)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.<>c__DisplayClass5_0.<Resolve>b__1(INetConnection n) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 62
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 60
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 51
Hi dear
First of all, thank you for sharing this source
Is it possible to add a button to deactivate the account ?
And the part that displays the date of the user's first connection
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException (0x8007030E): The system power state is transitioning from to . (0x8007030E)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 117
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 50
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.Runtime.InteropServices.COMException (0x8007030E): The system power state is transitioning from to . (0x8007030E)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 117
at WireGuardServerForWindows.Models.InternetSharingPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\InternetSharingPrerequisite.cs:line 50
Hi! Thanks @micahmo for the amazing WireGuard deployer for Windows.
I've used it to configure a WireGuard Server on a remote Windows Server 2019. But its not hiding the Client IP.
The configuration I used for Server is this: see screenshot (MYEXTERNALIPADDRESS is substituted by the real IP address)
And the configuration I used for Client is this: see screenshot (even using 1.1.1.1 as DNS the issue still happen)
When I connect everything, the handkshake is complete, but if I try "what is my ip" on Google, on client side, it still shows the real IP and not the Remote Windows Server 2019 IP.
Am I missing something?
Hi there,
First of all, thanks for this wonderful app.
So I am using Kubuntu Kinetic Kudu (22.10) with Linux kernel 5.19.7 from xanmod.
I am able to connect mas no ping and no rdp access port after connection.
In Windows 10 everything works fine.
Is there any trick?
Thanks
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Exception: New-NetNat : Ung�ltige Klasse
In Zeile:1 Zeichen:1
+ CategoryInfo : MetadataError: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [New-NetNat], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-NetNat
at WireGuardServerForWindows.Models.NewNetNatPrerequisite.Resolve(String serverDataPath) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\NewNetNatPrerequisite.cs:line 115
at WireGuardServerForWindows.Models.NewNetNatPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\NewNetNatPrerequisite.cs:line 68
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.Exception: New-NetNat : Ung�ltige Klasse
In Zeile:1 Zeichen:1
+ CategoryInfo : MetadataError: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [New-NetNat], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-NetNat
at WireGuardServerForWindows.Models.NewNetNatPrerequisite.Resolve(String serverDataPath) in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\NewNetNatPrerequisite.cs:line 115
at WireGuardServerForWindows.Models.NewNetNatPrerequisite.Resolve() in C:\Users\micah\source\repos\WireGuardServerForWindows\WireGuardServerForWindows\Models\NewNetNatPrerequisite.cs:line 68
Maybe i misreading the readme, but is there a way to disable the tunnel?
At the moment it seems you just always be on
In common situation, only public keys are required in the config for clients. However, the private key of clients is needed in WS4W. It's weird. Could it be removed or be set as optional?
The WireGuard team has requested that this application's name and logo be changed to not directly reference WireGuard. This issue will track work against that goal.
Specifically, the following requests have been made.
We have not been asked to change the following.
Please comment if any additional issues are introduced as a result of thse changes. Please also comment if you notice any lingering artifacts in the application once this issue is closed (in case I missed anything).
ws4w.exe
)As evidenced by #5, downloading and extracting the portable version of WS4W is not completely straightforward. A proper installer would address these issues.
Specifically, the installer should...
Wanting to try out my own routing with Windows' IP Routing, I disabled NAT & Internet Sharing.
Unfortunately wg_server won't get the desired IP address, just a Windows dynamic 169... address, if both options are turned off.
As a workaround I can manually execute
netsh interface ipv4 set address name="wg_server" static 192.168.170.1 255.255.255.0
but it would be better, if it could be done automatically with the correct ip address. I am not sure yet, how useful it is to disable NAT.
Hi,
In version 2.0.1.0 (ran as Administrator) I cannot specify in the Client an IPv6 address.
If the server's address is an IPv6 (e.g., fd4d:b189:9674::1/64) then Generate from Server button doesn't work and the program hangs.
If I manually enter an IPv6 address in Client (e.g., fd4d:b189:9674::2/64) then the box remains red. If I save this I get:
One or more clients has missing or incorrect configuration.
There's also a hint for Address field that an address should be a SINGLE address, but this is incorrect since I could provide BOTH an IPv4 and an IPv6 address.
Thx
Windows 2012R2 server (primary domain controller), all works fine but click in the "Enable" button for Persistent Internet Sharing does nothing so if the machine reboots Wireguard will not work. No error in event viewer.
I've seen a lot of post with this issue in Windows 10 that suggest change the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedAccess but that key doesn't exists in 2012R2, don't know if this app uses that way.
Hi,
I have a windows data center 2019 VM running on Msft Azure, after the initial setup all went smoothly. I stop the VM when I do not use it to save $, by doing this from the azure portal, the VM enters a "Stopped (deallocated)" state which relieves the VM of tying down resources and releases them to the pool for other customers to use, which is different from shutting down the VM from inside the VM i.e normal shutdown, this just enters a "Stopped" state, different from "Stopped (deallocated)" state. If I shutdown the VM from inside the VM, then the VM still holds onto the resources and WS4W works as expected, I imagine this would work fine for a normally shutdown VM/PC etc, all resources are retained on start up but not the case for Azure VM.
I'm using a Standard B2s (2 vcpus, 4 GiB memory)
When I need the VM back up and running, I start the VM from azure portal and since azure released the resources back to the shared pool, a new ethernet v-switch is created and a new ethernet adapter is also created, and wg_server tunnel has been removed.
To get this resolved, I need to manually install the tunnel service by opening WS4W gui in admin mode and pressing install tunnel service, during this process WS4W gui freezes and I need to manually restart the VM 2-3 times before wg_server is installed. After which all works fine, until I repeat the steps above. Is there something that I can do to persist wg_server interface and not have to do this on each VM start up?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.