kmutil fails when booted into OS on external drive

"kmutil load" will fail to load a 3rd party kernel extension when booted into an OS on an external drive. The same kernel extension will load fine when booting from the internal "Macintosh HD" .

"kmutil inspect" also fails with the same error message when booted using an external drive, but works fine when booting with the internal "Macintosh HD".

Both errors indicate the "kernelcache" file cannot be found:
Code Block
sh-3.2# /usr/bin/kmutil load -p /Library/Extensions/XXXX.kext
Error Domain=KMErrorDomain Code=71 "Could not find: Unable to get contents of boot kernel collection collection at /System/Volumes/Preboot/3B670FAA-F124-41AB-98A8-7C3940B5ECAC/boot/16FE8A65862647F7F8752DA7C4EF320E4CADEB250FCF438FB84A55F822BEB4A98108829E21658BB08B1E314BBC85169A/System/Library/Caches/com.apple.kernelcaches/kernelcache" UserInfo={NSLocalizedDescription=Could not find: Unable to get contents of boot kernel collection collection at /System/Volumes/Preboot/3B670FAA-F124-41AB-98A8-7C3940B5ECAC/boot/16FE8A65862647F7F8752DA7C4EF320E4CADEB250FCF438FB84A55F822BEB4A98108829E21658BB08B1E314BBC85169A/System/Library/Caches/com.apple.kernelcaches/kernelcache}


Code Block
sh-3.2# /usr/bin/kmutil inspect
No variant specified, falling back to release
Error Domain=KMErrorDomain Code=71 "Invalid argument: Unable to read contents of file at /System/Volumes/Preboot/3B670FAA-F124-41AB-98A8-7C3940B5ECAC/boot/904DF99E6EB1281F8E510B3FFB953383F530F313CCFB30A9C1F98231A81B02BDA5E6E0D2BF26FC5D4EB3D2E226B8BC1C/System/Library/Caches/com.apple.kernelcaches/kernelcache" UserInfo={NSLocalizedDescription=Invalid argument: Unable to read contents of file at /System/Volumes/Preboot/3B670FAA-F124-41AB-98A8-7C3940B5ECAC/boot/904DF99E6EB1281F8E510B3FFB953383F530F313CCFB30A9C1F98231A81B02BDA5E6E0D2BF26FC5D4EB3D2E226B8BC1C/System/Library/Caches/com.apple.kernelcaches/kernelcache}


The "kernelcache" file path does not exist. In fact, there is no "904DF..." directory under "boot". There is no "kernelcache" file in the entire "/System/Volumes/Preboot" mount.

Code Block
sh-3.2# find /System/Volumes/Preboot -name kernelcache
find: /System/Volumes/Preboot/.Trashes: Operation not permitted


This is on an M1 MacBook Air running 11.3.

Is there a special way to load kernel extensions when booting from an external drive?

Thanks.

I have exactly the same problem with P-Cloud extension when booting from external drive there is no way to load the extension, and P-Cloud drive can not be loaded. When booting form internal drive there is no problem Did some one find any solution?

kmutil fails when booted into OS on external drive
 
 
Q