NetworkExtension, OpenVPNAdapter used in MacOS, but print error "cannot open available utun device"

I also has config the container app and extension NetworkExtension capability, profile is correct. Why?

I don’t have any insight into this particular third-party library. If you can step through the code to find out the specific Apple API that’s triggering this log message, I’d be happy to comment on that. Otherwise, I recommend that you escalate this via the support channel for that library.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

this error triggered by this file utun.hpp

If I called the library in container app and debug process as root, this error will not happened. But VPN client should call this library in app Network Extension, this error is really weird

That code isn’t calling an API, but another routine within the same project. If I’m reading the code right, that’s this.

Looking at that routine it seems to be using the UTUN API directly. I can’t really help you with that. While this is a supported API, DTS has stopped support for ad hoc VPN clients based on this API in favour of Network Extension providers.

It seems like you’re trying to ‘cross the streams’ here, that is, building an NE provider (the modern stuff) while still using UTUN (the legacy stuff). I’m not surprised that’s ending badly.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I test on iOS, NetworkExtension and OpenVPNAdapter are worked well. My iOS device can connect remote server.

I don't know why MacOS is failed.

Should I used the system nextension on MacOS?

I test on iOS

On iOS the sandbox prevents you from accessing UTUN devices so you can only use the NE infrastructure. I suspect that the library you’re using behaves differently on iOS and macOS. Which brings me back to my original recommendation here: Escalate this via the support channel for the library you’re using.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NetworkExtension, OpenVPNAdapter used in MacOS, but print error "cannot open available utun device"
 
 
Q