2
votes

I'm trying load kext on macOS Sierra. but error occur. Please, someone help me.

1.

csrutil disable && reboot

disable SIP.

2.

nvram boot-"debug=0x146 kext-dev-mode=1" && reboot

kext developer mode.

3. kext build with xcode.

4.

cp -rf /Users//Library/Developer/Xcode/DerivedData//Build/Products/Debug /System/Library/Extensions

5.

kextload /System/Library/Extensions/test.kext

/System/Library/Extensions/test.kext failed to load - (libkern/kext) validation failure (plist/executable); check the system/kernel logs for errors or try kextutil(8).

6.

kextutil /System/Library/Extensions/test.kext

... Code Signing Failure: code signature is invalid

3
When booted into your test system, what does csrutil status output? And are you sure your kext does not show up in kextstat?pmdj
I'm having exactly the same problem. Any solution right now?ad_on_is

3 Answers

0
votes

If you are starting out with kext dev, don't put your kext in the Library/Extensions folder since this may cause a disaster if something goes wrong in your kext and prevent your OS from booting. You can load it from anywhere other than Library/Extensions.

The kext should load unless there's an obvious mistake of having csrutils being enabled. Just like someone from the comments said, check whether you have SIP turned on by using csrutil status. If not, I'm guessing you have a faulty plist in your project. Please post your plist so that I can take a look.

Referring to your 2. Starting from sierra nvram will not work unless you're in recovery mode.

If you have your csrutil disabled, you'll see

kext signature failure override allowing invalid signature -67050 0xFFFFFFFFFFFEFA16 for kext

after your Code signing failure prompt and then load your kext successfully.

0
votes

Regarding step #2, according to Apple,

As of macOS El Capitan, the kext-dev-mode boot-arg is now obsolete.

$ sudo nvram boot-args="kext-dev-mode=1" # Has No Effect
0
votes

You can simply add Oracle editor in this authorization list. Restart your mac in Recovery mode (cmd + R)

Then open a Terminal and enter :

spctl kext-consent add VB5E2TV963

Restart your mac. Ok for me with Mojave and Virtual Box 6.