Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

OpenVPN reported fatal error. Failed to open wintun adapter #251

Closed
TrueBeastEmperor opened this issue Oct 31, 2024 · 7 comments
Closed
Assignees
Labels

Comments

@TrueBeastEmperor
Copy link

OpenVPN reported fatal error.
Failed to open wintun adapter: {0a7dae7c-68a5-599c-97da-5378d77f1bb3}

Same stuff no matter what I do.

@luca827
Copy link

luca827 commented Nov 9, 2024

I am experiencing the same issue on two computers. When I run eduVPN with administrator privileges, the application works normally.

@rozmansi rozmansi self-assigned this Nov 13, 2024
@rozmansi rozmansi added the bug label Nov 13, 2024
@rozmansi
Copy link
Member

rozmansi commented Nov 13, 2024

I managed to reproduce your issue.

Started my test PC, and at first attempt eduVPN client connected using OpenVPN and Wintun normally. Went on writing detailed instructions for you, how you can troubleshoot the situation. Returned to my test PC to make some more screenshots, but hit the same issue as you. Repeatedly. Noticed the Windows were installing KB5001716, KB5046542 and KB5046613 updates in the background. Until updates were installed all attempts to create a Wintun adapter by eduVPN client were failing. After updates were installed and computer restarted, the eduVPN client, OpenVPN and Wintun adapter were working normally again.

Can you confirm, it is working for you too now, please?

@luca827
Copy link

luca827 commented Nov 16, 2024

I have installed all updates on my computer to ensure that Windows is not performing updates in the background and restarted it. The problem still occurs (OpenVPN reported a fatal error. Failed to open wintun adapter: {6493f37e-9f80-525d-831a-082b3f77fef4}). eduVPN only works when I run the client with administrator privileges.

@rozmansi
Copy link
Member

OK, then...

  1. Please consult the OpenVPN logs found in C:\Program Files\eduVPN\OpenVPN\config. There should be some fatal errors like "Creating Wintun adapter failed using service" in there and some status numbers that could shed me some light what went wrong. Can you locate those logs and e-mail them to me for analysis, please?

  2. Quit the eduVPN client, or at least make sure it is disconnected from a VPN, and run Device Manager as Administrator. Expand the Network Adapters node. There should be no Wintun adapters there.

    When eduVPN Client is connected:
    image

    When eduVPN Client is not connected:
    image

    If there are any Wintun adapters, delete them. When you are deleting the last one, you may choose to uninstall the driver. It will be reinstalled automatically on the next connection attempt.

I am really curious to get your feedback, and thank you for your patience.

@luca827
Copy link

luca827 commented Nov 22, 2024

I have ensured that my computer is not doing any updates. Then, I deleted the existing logs. I checked the Device Manager while eduVPN was still closed, and there was no wintun adapter. When I open the client, the adapter shown in the screenshot appears as soon as a connection attempt is started. When I close the application, the adapter is removed again. The logs:

Pc:

2024-11-22 22:44:09 interactive service msg_channel=952
2024-11-22 22:44:09 GDG6: remote_host_ipv6=n/a
2024-11-22 22:44:09 NOTE: GetBestInterfaceEx returned error: Element nicht gefunden. (code=1168)
2024-11-22 22:44:09 open_tun
2024-11-22 22:44:09 Wintun adapter OpenVPN Wintun/{6493F37E-9F80-525D-831A-082B3F77FEF4} created via service
2024-11-22 22:44:09 CreateFile failed on wintun device: \?\SWD#Wintun#{6493F37E-9F80-525D-831A-082B3F77FEF4}#{cac88484-7515-4c03-82e6-71a87abac361}
2024-11-22 22:44:09 MANAGEMENT: Client disconnected
2024-11-22 22:44:09 Failed to open wintun adapter: {6493f37e-9f80-525d-831a-082b3f77fef4}
2024-11-22 22:44:09 Exiting due to fatal error

Laptop:

2024-11-22 22:56:54 GDG6: remote_host_ipv6=n/a
2024-11-22 22:56:54 NOTE: GetBestInterfaceEx returned error: Element nicht gefunden. (code=1168)
2024-11-22 22:56:54 open_tun
2024-11-22 22:56:55 Wintun adapter OpenVPN Wintun/{039DFFA5-A3B4-5197-803B-0F3CC7ED75C4} created via service
2024-11-22 22:56:55 CreateFile failed on wintun device: \?\SWD#Wintun#{039DFFA5-A3B4-5197-803B-0F3CC7ED75C4}#{cac88484-7515-4c03-82e6-71a87abac361}
2024-11-22 22:56:55 MANAGEMENT: Client disconnected
2024-11-22 22:56:55 Failed to open wintun adapter: {039dffa5-a3b4-5197-803b-0f3cc7ed75c4}
2024-11-22 22:56:55 Exiting due to fatal error

This issue has been occurring on my laptop for several months and only started happening on my desktop PC a few days before creating this issue.
When I run eduVPN with administrator privileges, the application works as intended:

2024-11-22 22:49:40 GDG6: remote_host_ipv6=n/a
2024-11-22 22:49:40 NOTE: GetBestInterfaceEx returned error: Element nicht gefunden. (code=1168)
2024-11-22 22:49:40 open_tun
2024-11-22 22:49:40 Wintun adapter OpenVPN Wintun/{6493F37E-9F80-525D-831A-082B3F77FEF4} created via service
2024-11-22 22:49:40 Ring buffers registered via service
2024-11-22 22:49:40 wintun device [OpenVPN Wintun] opened

I apologize for the delay in my response. Thank you for taking the time to help me, I really appreciate it! Please let me know if you need the detailed logs, and I'll provide them.

@rozmansi
Copy link
Member

Thank you for your feedback.

I suspect we are suffering the same issue as OpenVPN/ovpn-dco-win#38. Some posts there suggest installing the software elevated (Run as Administrator). Installing using our EXE installer already does that, so it shouldn't make any difference in your case.

I have also upgraded future versions of eduVPN client to include the reason why CreateFile failed on wintun device, like the stock OpenVPN did. However, I am suspecting you will just get the same Access Denied (code=5) as people do with ovpn-dco-win.

Given others have already tried to uninstall the product, remove TUN devices, uninstall the driver to no avail, I have no idea how to fix this. Something seems to be different with your Windows. Maybe some configuration change, security settings, or some other security/anti-virus/sandboxing software?

Fixing this should involve a deep surgery in OpenVPN to move adapter handling from openvpn.exe process to openvpnserv.exe.

@rozmansi
Copy link
Member

rozmansi commented Dec 3, 2024

We are moving to https://codeberg.org/eduVPN/windows/issues/251
Sorry for the inconvenience.

@rozmansi rozmansi closed this as completed Dec 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants