jwise / HoRNDIS

Android USB tethering driver for Mac OS X
Other
2.95k stars 328 forks source link

macOS 11 Big Sur Support? #132

Open krjw-eyev opened 3 years ago

krjw-eyev commented 3 years ago

I am hesitant of upgrading to macOS 11 Big Sur since they have deprecated certain functionalities that seem to be necessary fo HoRNDIS to work.

Here is a list: https://developer.apple.com/support/kernel-extensions/

Does anyone know if there is a possibility to transition? I have no experiences with kernel extensions.

sfstpala commented 3 years ago

Can confirm it doesn't work on big Sur :(

krjw-eyev commented 3 years ago

have you tried with disabling SIP?

sfstpala commented 3 years ago

Okay wow, that worked. I would prefer having SIP enabled but I will deal with it for now.

(PS I did compile it myself and had Xcode apply a bunch of migrations. I have no idea if that has made a difference.)

d235j commented 3 years ago

I would expect disabling SIP to be a short-term workaround. Long-term someone would need to rewrite this as a System Extension (using NetworkingDriverKit). I don't know if anyone is planning to do that.

Belcarra commented 3 years ago

The official route forward is a DriverKit extension using NetworkingDriverKit and USBDriverKit.

It is difficult to get the appropriate USB entitlements for anything other than your own vendor ID (i.e. one that is owned by the organization that is applying for the entitlement.)

USB device matching is limited to the vendor ID that is in your entitlements. Class only matching will not work (i.e. match USB Class, Sub-Class and Protocol).

On Fri, Nov 13, 2020 at 11:26 AM David Ryskalczyk notifications@github.com wrote:

I would expect disabling SIP to be a short-term workaround. Long-term someone would need to rewrite this as a System Extension (using NetworkingDriverKit). I don't know if anyone is planning to do that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jwise/HoRNDIS/issues/132#issuecomment-726988494, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALJH5FS5EKVKUT4OLHXRJLSPWB7DANCNFSM4TUYR73Q .

-- Belcarra Embedded USB Software Stuart_Lynne sl@belcarra.com 604-461-7532 Alternates: 604-283-7475 and 604-518-1749(cell) http://usblan.belcarra.com http://www.belcarra.com

d235j commented 3 years ago

@Belcarra Ugh. This is the type of situation where Apple should either implement the standard officially, or provide an exception to that rule. Has anyone made a request for Apple to add RNDIS support via Feedback Assistant?

d235j commented 3 years ago

Apple did add support for CDC-ECM to macOS, which some Android phones have. Ideally, Android phones would support both RNDIS for Windows hosts and CDC-ECM for non-Windows hosts, but that is not the case.

Further, as the primary use-case is wired internet access via Android devices, Apple's likely to simply suggest you buy an iPhone.

Perhaps, but Apple is interested in minimizing the need for third party drivers. For instance, they have added built-in support for all major USB-serial devices.

The lack of RNDIS standardization is probably a bigger problem. That said, this driver has plenty of bugs anyway.

jwise commented 3 years ago

The lack of RNDIS standardization is probably a bigger problem. That said, this driver has plenty of bugs anyway.

There is no standard. It's Microsoft's proprietary implementation of CDC. If anything, Microsoft should support the open CDC standards.

https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/WinArchive/%5BMS-RNDIS%5D.pdf

https://docs.microsoft.com/en-us/windows-hardware/drivers/network/remote-ndis-to-usb-mapping

jwise commented 3 years ago

The official route forward is a DriverKit extension using NetworkingDriverKit and USBDriverKit. It is difficult to get the appropriate USB entitlements for anything other than your own vendor ID (i.e. one that is owned by the organization that is applying for the entitlement.) USB device matching is limited to the vendor ID that is in your entitlements. Class only matching will not work (i.e. match USB Class, Sub-Class and Protocol).

Yes, this is what I was thinking, though I was thinking that the answer would be to use libusb and NetworkingDriverKit (which might be a reasonable workaround for the USBDriverKit matching trouble).

That said, I don't even have hardware that's capable of running Big Sur, and I have no plans to upgrade past Mojave (and my primary machine is a Linux machine these days, anyway...). So if someone else wants to do this, they are welcome to do so, but I'm not convinced that you'd even get to reuse much code...

I agree that Apple really ought to support this natively.

bisaalz commented 3 years ago

(Hackintosh Only) Horndis is working fine on macOS big sur final version with OpenCore BootLoader

  1. make sure you have working ethernet kext such as rtl8111 kext, intelmausi kext or other compatible kext
  2. https://www.icloud.com/iclouddrive/0jlcfKZP8E_6g64mhb86iSg_g#horndis download horndis.kext from here
  3. copy it into oc/kext folder
  4. oc snapshot it with propertree
  5. restart pc.
  6. in android enable usb debugging in developer option
  7. connect wifi in android and enable usb tethering while connecting it from usb cable.
androidmalin commented 3 years ago

@bisaalz I have a question. Where is this directory "oc/kext" ? The file you provided is a compressed package. This package has two file HoRNDIS-9.2.pkg and HoRNDIS.kext.

bisaalz commented 3 years ago

@bisaalz I have a question. Where is this directory "oc/kext" ? The file you provided is a compressed package. This package has two file HoRNDIS-9.2.pkg and HoRNDIS.kext.

oh sorry this for hackintosh only and only horndis.kext needed but on real mac i don't think it will work on big sur Because i have tested by putting hordis.kext on library/extension and rebuild the cache of library/extension and it didn't work but in catalina it worked. if u have catalina with real mac https://www.youtube.com/watch?v=lzbBfAF1rrI follow this guide you can try on big sur but i don't think it will work and don't forget to allow kext loading on security&privacy in settings when warning shows up. This method didn't work for me on big sur. If you have hackintosh put horndis.kext file in opencore bootloader inside Kext folder of OC folder. like OC/Kext/horndis.kext and oc snapshot it with propertree software https://github.com/corpnewt/ProperTree..

androidmalin commented 3 years ago

@bisaalz thank you very much, I try it, It didn't work in mac os big sur.

ben-xD commented 3 years ago

Excellent, thanks @bisaalz. I added it to my hackintosh and its working beautifully.

sfatih commented 3 years ago

Hey guys, I give feedback about the issue to Apple and the answer was:

image

For the SIP-enabled usage, they recommend kext notarization: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution

ForceGT commented 3 years ago

If anyone had it working, kindly leave a link to an executable or something

ForceGT commented 3 years ago

This could be an alternative to people looking for a wireless solution without changing the wifi card

Roboromeo1 commented 3 years ago

disabling sip and running this command worked for me with big sur

sudo kextload /Library/Extensions/HoRNDIS.kext

i'm using 2015 macbook pro i5 8g 512gb ssd

Kavithacypress commented 3 years ago

disabling sip and running this command worked for me with big sur

sudo kextload /Library/Extensions/HoRNDIS.kext

i'm using 2015 macbook pro i5 8g 512gb ssd

@Roboromeo I have tried but it tells me

Extension with identifiers com.joshuawise.kexts.HoRNDIS not approved to load. Please approve using System Preferences. and nothing in System Preferences... I have disabled SIP by the way.

krjw-eyev commented 3 years ago

@Kavithacypress I think you need to go to Settings -> Security & Privacy and then the tab General. In the lower half of the view you should be able to allow loading the kext. This appears only for a couple of minutes after you tried to load the kext.

Velolong commented 3 years ago

Same probleme here. I tried to install Horndis on Big Sur (real Mac, not Hackintosh), with the following lines in terminal (recovery mode and normal mode)

ForceGT commented 3 years ago

The maintainer already said that this won't be - officially supported

Velolong commented 3 years ago

Yes, I understand, but for Catalina, some found a workaround, I thought maybe some one could advise a way to do. My only issue here is how to get the "allow" button to appear. It seems to be a bug in Big Sur rather than a incompatibility of Horndis.

Or maybe some one has an advice for an USB tethering solution from android to Mac ?

Roboromeo1 commented 3 years ago

I got it working in my Big sur update , I have macbook book pro i5 , 512 gb ssd early 2015 . First thing i did is went to recovery mode , terminal csrutil disable i.e i disabled the sip and then install hornidis it wont open . go to system preferences and allow horndis installer then again click hornidis install and system preferences allow installer and it should install. then restart mac once and it worked and then after install i again enabled my sip and it still works :)

Velolong commented 3 years ago

@Roboromeo1

"go to system preferences and allow horndis installer" The problem is that I don't have any button or whatever allowing me to allow neither the install nor the kext in the System Preferences Panel. I go there, "Security", under "general" tab, but nothing. I would really like to allow, but I can't :D

Roboromeo1 commented 3 years ago

@Velolong not sure whats the issue on your side it works fine for me , after installation i enabled sip and still it works . Have attached a screen shot below for your reference .

Screen Shot 2020-12-05 at 1 27 18 pm
Prophetia086 commented 3 years ago

There is a way to install AX88179 Drivers for Big Sur 11.0, and which did work in may mac is this:

" Revised instructions to install AX88179-179A USB-Ethernet driver on Mac OS 11 (Big Sur) Thanks for all who confirmed these instructions actually works even with scenarios that one find himself stuck like after re-enabling SIP using csrutil enable in recovery mode. Point 12 solves this particular issue. However, everybody should follow all these instructions including point 12. Thanks volodymyrk for correction.

Follow these instructions carefully: 1- Unplug your USB-Ethernet device. 2- Get the latest version and discard all advices about using older versions. Get version 2.19 (beta2) which is currently available. Do NOT install driver now ! 3- Uninstall old driver first using the uninstaller that comes with the latest driver. You will have to restart. 4- Wait your screen to be off due to Restart, then directly... (next point) 5- Keep holding Command+R wile your PC is booting. Keep holding until the Apple logo appears. (If you fail to enter recovery mode, shut down and repeat this point). 6- Select your account and enter password. 7- Choose Utilities > Terminal. 8- csrutil disable 9- /usr/sbin/spctl kext-consent list 10- If 5RHFAZ9D4P is not in the list, enter: /usr/sbin/spctl kext-consent add 5RHFAZ9D4P . Otherwise, skip this point. 11- Restart you mac. 12- This is the critical point which you might miss from all other instructions available: Remove Allow permission you provided earlier to asix team (5RHFAZ9D4P). This is important to let your OS accept the device again. Follow these steps carefully: sudo su (enter your password if prompted), then enter these four lines by sequence:

sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy

delete from kext_load_history_v3 where team_id='5RHFAZ9D4P'; delete from kext_policy where team_id='5RHFAZ9D4P'; .quit

13- Install driver. 14- Now you will be prompt to Allow this driver in System Preferences -> Security & Privacy. 15- Connect your USB-Ethernet device. 16- Your USB-Ethernet device should work by now. Ensure you have ethernet connected to router/Switch to verify. 17- If it does not yet work, try running this in terminal: sudo kextload -b com.asix.driver.ax88179-178a " from here: https://developer.apple.com/forums/thread/651132?page=2

When I delete the date in kext_load_history_v3 and kext_policy, I can see the Allow button again.

But I don't know what does 5RHFAZ9D4P mean, and what code it should be in HoRNDIS.

I hope it can help someone here, and get a better way to do.

Velolong commented 3 years ago

@Prophetia086

Thanks a lot for the tip! It may be helping indeed! I'll try it and tell you.

Velolong commented 3 years ago

Unfortunately, I can't make it work, since I have no such a file /usr/sbin/spctl kext-consent list....

I'm stuck. The USB tethering is very important for my daily work, and I can't find a way to make it work on Big Sur.... It always end with "Extension with identifiers com.joshuawise.kexts.HoRNDIS not approved to load. Please approve using System Preferences" with nothing to allow on Pref Panel. It's really annoying....

Any clue, anyone ? Please ? :D

Velolong commented 3 years ago

I come back with good news: I finally made it work ! Thank a lot to Prophetia086 and to others tips I collected here, here and there to make it work. Here is my path :

First, we need to get the developer ID and check whether that extension has been notarized. One easy way to do this is to type most of the command • spctl -a -vv -t install then drag and drop the extension from your Downloads folder to the end of that line, where its path and name should appear, e.g. /Users/Downloads/Horndis.kext Then press Return, and you should see three lines of response: • mykext.kext: accepted • source=Developer ID • origin=Developer ID Application: DeveloperName (54GTJ2AU36) If the extension is notarized already, they will instead look like • mykext.kext: accepted • source=Notarized Developer ID • origin=Developer ID Application: DeveloperName (54GTJ2AU36) Make a note on paper or your iOS device of the developer ID provided in parentheses, as you’ll need those in a few moments.

Close your apps down and restart your Mac in Recovery mode. There, open Terminal and type in the command • csrutil disable • /usr/sbin/spctl kext-consent list If 54GTJ2AU36 is not in the list, enter • /usr/sbin/spctl kext-consent add 54GTJ2AU36. Press Return, wait for the command prompt to appear again, then quit Terminal and restart in normal mode.

Remove Allow permission you provided earlier to Horndis (54GTJ2AU36). This is important to let your OS accept the device again. Follow these steps carefully: • sudo su (enter your password if prompted), then enter these four lines by sequence: • sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy • delete from kext_load_history_v3 where team_id='54GTJ2AU36'; • delete from kext_policy where team_id='54GTJ2AU36'; • .quit

Manually erase any previous horndis.kext remained in library/extensions (just to be sure). Install Horndis 9.2 Catalina Install pkg). Now you will be prompt to Allow this driver in System Preferences -> Security & Privacy.

Restart in recovery mode to enable csrutil • csrutil enable

Restart in normal mode and enjoy it working (at least, for me it did work)

I am so happy :D I hope this walkthrough will help others people with the same issue on Big Sur. Yes, I almost forgot : I upgraded to Big Sur 11.1 before doing this whole process. It may have be helping.

Prophetia086 commented 3 years ago

@Velolong You really did a great job! I made my mac work by following your steps in just a quarter. Thanks a lot!

Velolong commented 3 years ago

:)

VKrau commented 3 years ago

@Velolong Thank you! It really works on Big Sur 11.1

Velolong commented 3 years ago

You're welcome ;)

Malik056 commented 3 years ago

csrutil not found in recovery mode

tibeemts commented 3 years ago

I come back with good news: I finally made it work ! Thank a lot to Prophetia086 and to others tips I collected here, here and there to make it work. Here is my path :

First, we need to get the developer ID and check whether that extension has been notarized. One easy way to do this is to type most of the command • spctl -a -vv -t install then drag and drop the extension from your Downloads folder to the end of that line, where its path and name should appear, e.g. /Users/Downloads/Horndis.kext Then press Return, and you should see three lines of response: • mykext.kext: accepted • source=Developer ID • origin=Developer ID Application: DeveloperName (54GTJ2AU36) If the extension is notarized already, they will instead look like • mykext.kext: accepted • source=Notarized Developer ID • origin=Developer ID Application: DeveloperName (54GTJ2AU36) Make a note on paper or your iOS device of the developer ID provided in parentheses, as you’ll need those in a few moments.

Close your apps down and restart your Mac in Recovery mode. There, open Terminal and type in the command • csrutil disable • /usr/sbin/spctl kext-consent list If 54GTJ2AU36 is not in the list, enter • /usr/sbin/spctl kext-consent add 54GTJ2AU36. Press Return, wait for the command prompt to appear again, then quit Terminal and restart in normal mode.

Remove Allow permission you provided earlier to Horndis (54GTJ2AU36). This is important to let your OS accept the device again. Follow these steps carefully: • sudo su (enter your password if prompted), then enter these four lines by sequence: • sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy • delete from kext_load_history_v3 where team_id='54GTJ2AU36'; • delete from kext_policy where team_id='54GTJ2AU36'; • .quit

Manually erase any previous horndis.kext remained in library/extensions (just to be sure). Install Horndis 9.2 Catalina Install pkg). Now you will be prompt to Allow this driver in System Preferences -> Security & Privacy.

Restart in recovery mode to enable csrutil • csrutil enable

Restart in normal mode and enjoy it working (at least, for me it did work)

I am so happy :D I hope this walkthrough will help others people with the same issue on Big Sur. Yes, I almost forgot : I upgraded to Big Sur 11.1 before doing this whole process. It may have be helping.

This is totally work on Big Sur with my Mi10T pro. Thank you guy

Velolong commented 3 years ago

@tibeemts Glad it helped you! @Malik056 What do you mean by "not found" ? If you hav Big Sur, csrutil is automatically enabled. You did try to launch the command via the recovery mode, right ?

rreitz commented 3 years ago

While executing the step: sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy • delete from kext_load_history_v3 where team_id='54GTJ2AU36' ... I get: sqlite> delete from kext_load_history_v3 where team_id='54GTJ2AU36'; Error: attempt to write a readonly database

It looks like another process is using the database: zippy:~ $ sudo lsof /var/db/SystemPolicyConfiguration/KextPolicy Password: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME syspolicy 249 root 4u REG 1,5 53248 742717 /private/var/db/SystemPolicyConfiguration/KextPolicy zippy:~ $

Do I kill 'syspolicy'? Thanks.

Velolong commented 3 years ago

@rreitz I am not sure this error is linked to another process using the database. With " attempt to write a readonly database", it looks like csrutil is still activated. But I am no expert in terminal or coding, maybe someone wiser would be able to advise you.

Prophetia086 commented 3 years ago

@rreitz The error "attempt to write a readonly database", maybe you haven't disable the SIP yet, I guess .

rreitz commented 3 years ago

Yes, I neglected to disable SIP. I have installed HoRNDIS on Big Sur. Thanks for you response.

Prophetia086 commented 3 years ago

@rreitz You're welcome :)

ForceGT commented 3 years ago

Just updated to Big Sur today and can confirm that it works seamlessly as before

ghost commented 3 years ago

Hello,

Personally, I still have problems, the HoRNDIS driver does not work with macOS Big Sur 11.2 or 11.3 (beta). I tried @Prophetia086's solution and to disable SIP as in the Apple documentation: https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection

But it doesn't work for me

luxagroove commented 3 years ago

Hi,

after trying all the ways mentioned above, I found one, which is much easier and faster. Just downloaded the DJI Assistant 2 for Mavic from the DJI support website (https://www.dji.com/de/downloads/softwares/assistant-dji-2-for-mavic) and ran the installer. This installer included the HoRNDIS driver, and no jumping around with enable/disable csrutil and Recovery Mode needed. Just one normal reboot needed. And it works for me now.

ghost commented 3 years ago

Hi, @luxagroove thank you for your help unfortunately it doesn't work for me. Maybe you are using an Intel Mac and this method does not work with M1 chips?

luxagroove commented 3 years ago

Hmm, yes, I am using an Intel Mac. So what is not working for you? Does the installation of the DJI Assistant app fails? Which version are you trying to install?

wglas85 commented 3 years ago

The official route forward is a DriverKit extension using NetworkingDriverKit and USBDriverKit. It is difficult to get the appropriate USB entitlements for anything other than your own vendor ID (i.e. one that is owned by the organization that is applying for the entitlement.) USB device matching is limited to the vendor ID that is in your entitlements. Class only matching will not work (i.e. match USB Class, Sub-Class and Protocol).

Yes, this is what I was thinking, though I was thinking that the answer would be to use libusb and NetworkingDriverKit (which might be a reasonable workaround for the USBDriverKit matching trouble).

That said, I don't even have hardware that's capable of running Big Sur, and I have no plans to upgrade past Mojave (and my primary machine is a Linux machine these days, anyway...). So if someone else wants to do this, they are welcome to do so, but I'm not convinced that you'd even get to reuse much code...

Hello @jwise,

do you have an active developer group on developer.apple.com and might it be possible to add me to this group, so we might try develop a NetworkingDriverKit extensionen, which might replace HoRNDIS?

Best Regards, Wolfgang

ghost commented 3 years ago

@luxagroove Hi sorry to reply after so long, the driver installation works because the DJI Assistant application starts well, but during the installation there is no HoRNDIS validation step in Security and Privacy. So, I think the problem is with the HoRNDIS driver. If it works with Big Sur and intel chip, then it means that the problem is probably related to the M1

anafaggiano commented 3 years ago

@luxagroove Hello,

Thanks for the workaround suggestion. However.. It's not working for me. I am on a MacBook Pro 2018 Intel i7.

I downloaded and ran the installer for DJI2, following the link you provided. It installed correctly and when prompted, I enabled the permissions for a joshua wise app (I think it even said horndis) in my System Preferences. So far, so good. I restarted my computer and... no luck: I plugged in my Android phone via USB, enabled USB tethering in my phone options and it never shows up in the Network window in the System Preferences.

In doubt, I unplugged my phone, restarted my computer a second time, re-plugged it and re-enabled usb tethering. I listed my drivers /System/Library/Extensions ls | grep ".kext", also tried with grep -i "horndis", I can't seem to find the horndis driver.

Last, I tried moving the mavic Application to trash and re-installing it, but I never got prompted for the permissions again (I guess that makes sense). Any advice ?