pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.82k stars 838 forks source link

Driver deactivates upon reboot #2503

Open RafalLukawiecki opened 3 years ago

RafalLukawiecki commented 3 years ago

I am unsure if this is a duplicate or related to #2473, feel free to close if it is. In my case, the procedure for deactivating/rebooting/activating/permitting the driver works. I can use the software. Unfortunately, when I reboot the machine the driver no longer works. Clicking Activate brings a message that activation was successful immediately, without having to repermission it in system preferences. Unfortunately, it does not work.

The workaround is to deactivate it and, without rebooting, activate it again, which forces the permissioning stage.

These log messages may be of interest:

[2020-11-10 12:07:57.185] [error] [observer] grabber_client error: Connection reset by peer
[2020-11-10 12:07:57.185] [info] [observer] grabber_client is closed.
[2020-11-10 12:07:58.187] [info] [observer] grabber_client is connected.
[2020-11-10 12:07:58.187] [info] [observer] rescan devices...
[2020-11-10 12:08:00.513] [info] [console_user_server] receiver is initialized
[2020-11-10 12:08:00.562] [info] [console_user_server] receiver: bound
[2020-11-10 12:08:00.562] [info] [console_user_server] grabber_client is started.
[2020-11-10 12:08:00.563] [info] [console_user_server] grabber_client is connected.
[2020-11-10 12:08:01.006] [info] [grabber] karabiner_console_user_server is connected.
[2020-11-10 12:08:01.006] [info] [grabber] console_user_server_client is connected. (uid:501)
[2020-11-10 12:08:01.010] [info] [grabber] device_grabber is started.
[2020-11-10 12:08:01.034] [info] [grabber] event_tap_monitor initialized
[2020-11-10 12:08:01.034] [info] [grabber] Load /Users/someone/.config/karabiner/karabiner.json...
[2020-11-10 12:08:01.036] [info] [grabber] core_configuration is updated.
[2020-11-10 12:08:01.038] [info] [grabber] virtual_hid_device_service_client_ connected
[2020-11-10 12:08:01.038] [info] [virtual_hid_device_service] io_service_client::async_start
[2020-11-10 12:08:01.074] [info] [console_user_server] Load /Users/someone/.config/karabiner/karabiner.json...
[2020-11-10 12:08:01.093] [info] [console_user_server] core_configuration is updated.
[2020-11-10 12:08:01.094] [info] [grabber] `system_preferences` is updated.
[2020-11-10 12:08:01.366] [info] [console_user_server] Check for updates...
[2020-11-10 12:08:02.011] [warning] [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt
[2020-11-10 12:08:02.061] [info] [grabber] caps lock is found on KB800HM Kinesis Freestyle2 for Mac
[2020-11-10 12:08:02.061] [warning] [grabber] virtual_hid_keyboard is not ready. Please wait for a while.
[2020-11-10 12:08:02.062] [info] [grabber] caps lock is found on AC800HPB Kinesis Freestyle 2 Keypad
[2020-11-10 12:08:03.010] [warning] [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt
[2020-11-10 12:08:04.010] [warning] [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt
[2020-11-10 12:08:05.012] [warning] [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt
[2020-11-10 12:08:06.012] [warning] [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt
...
tekezo commented 3 years ago

This issue might be caused by anti-virus software. https://github.com/pqrs-org/Karabiner-Elements/issues/2445#issuecomment-718327064

Are there any crash reports?

RafalLukawiecki commented 3 years ago

Sorry, no crashes. Everything seems to work fine except the driver deactivation.

tekezo commented 3 years ago

Hmm, could you show me the following command result in Terminal?

systemextensionsctl list

An example of result:

1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)      name    [state]
*       *       G43BCU2T37      org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0)     org.pqrs.Karabiner-DriverKit-VirtualHIDDevice   [activated enabled]
RafalLukawiecki commented 3 years ago

Thank you for following up. Here it is:

systemextensionsctl list
2 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)      name    [state]
*       *       G43BCU2T37      org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0)     org.pqrs.Karabiner-DriverKit-VirtualHIDDevice       [activated enabled]
                G43BCU2T37      org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0)     org.pqrs.Karabiner-DriverKit-VirtualHIDDevice       [terminated waiting to uninstall on reboot]
tekezo commented 3 years ago

Thank you for information! Is these steps solve this issue?

  1. Reboot macOS.
  2. Confirm [terminated waiting to uninstall on reboot] line is removed in the list after reboot.
  3. If the Karabiner-Elements driver alert is still shown, click deactivate driver.
  4. Reboot macOS.
  5. Confirm no line is shown by systemextensionsctl list.
  6. Open Karabiner-Elements Preferences and activate driver.
RafalLukawiecki commented 3 years ago

I have rebooted once more, and this time I can only see one line in the output:

systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)  name    [state]
*   *   G43BCU2T37  org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0) org.pqrs.Karabiner-DriverKit-VirtualHIDDevice   [activated enabled]

Which is what you have expected, I assume. Further, the driver seems to be working this time and Karabiner Elements is functioning correctly. Thank you for your help.

I will monitor this for another couple of days, and if the issue comes back I will post an update here, otherwise I will close the issue in a couple of days, if you wish.

RafalLukawiecki commented 3 years ago

Unfortunately, on the next reboot, the drive has stopped working, that is, Karabiner Elements has no effect on the behaviour of my keyboard. The driver seems to be loaded:

systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)      name    [state]
*       *       G43BCU2T37      org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0)     org.pqrs.Karabiner-DriverKit-VirtualHIDDevice       [activated enabled]

but it is not doing anything. Going to KE preferences, shows this screen:

Screenshot 2020-11-11 at 18 50 54

And it looks like I am back in the loop of having to deactivate and reactivate it again. Is there any other diagnostics I could share with you? Many thanks.

tm1000 commented 3 years ago

Experiencing the same issues as @RafalLukawiecki. Exactly the same even after running through the steps provided by @tekezo. For me it's not disabled on every reboot just random reboots.

brokofankone commented 3 years ago

Experiencing the same issue. I am also experiencing a worsened behaviour of my TB3 dock. Normally, there is a bug where it can crash the mac if the machine was sleeping for a while with no attached dock, and then the dock is plugged in.

For the last two days, unplugging and plugging the dock results in an instant system malfunction (usb devices in the dock stop working) and then the mac cannot be restarted. It has to be shut down by holding the power button.

There is no explanation as to why this behaviour worsened by I noticed that the karabiner elements update coincides with the timing of this behavior.

edit: After rolling back to Karabiner ver.12 it seems that the worsened TB3 dock behavior has reverted back to its previous state. It's been a day but I unplugged/plugged the dock a few times and it never resulted in a malfunction.

dvdplm commented 3 years ago

I had the same issue here after updating my system with the latest Catalina Supplemental Update, 10.15.7 (19H15). systemextensionsctl list showed a single row and a reboot seems to have fixed the issue (I guess we'll see). Not sure if this is relevant/useful.

grumbleafrican commented 3 years ago

Consistently seeing the same behavior reported above.

angelmic commented 3 years ago

macOS 11.2 has same issue

systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)  name    [state]
*   *   G43BCU2T37  org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0) org.pqrs.Karabiner-DriverKit-VirtualHIDDevice   [activated enabled]
bnb commented 3 years ago

Also hitting this on macOS 11.2.

$ systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)      name    [state]
*       *       G43BCU2T37      org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0)     org.pqrs.Karabiner-DriverKit-VirtualHIDDevice   [activated enabled]
rrlorentzen commented 3 years ago

I am also having this issue on macOS 11.2. I have followed the 'advanced' instructions multiple times in the driver alert dialog that appears when Karabiner-Elements starts.

~ ➜  systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled active  teamID  bundleID (version)  name    [state]
*   *   G43BCU2T37  org.pqrs.Karabiner-DriverKit-VirtualHIDDevice (1.0.0/1.0.0) org.pqrs.Karabiner-DriverKit-VirtualHIDDevice   [activated enabled]
mrdc commented 3 years ago

The same issue on 10.15.7 (19H114). Deactivating, rebooting, activating doesn’t help. systemextensionsctl list shows activated enabled, but the app says that the driver is not loaded. Also in app logs I see [virtual_hid_device_service] driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt

BTW Karabiner Elements 12.10 works fine with 10.15.7.

rbrtribeiro commented 3 years ago

Also getting driver_version_ is mismatched: client expected: 10300, actual dext: std::nullopt.

Version 12.10 worked fine in Catalina, but updating to Big Sur, nothing works anymore.

pocket5s commented 3 years ago

Same here on BigSur after recent update. systemextensionsctl list shows it is activated and not waiting on anything, but the log shows the driver mismatch, logging it every second. Tried rebooting, reinstalling, etc.

jasamuels commented 3 years ago

+1 having same issue on latest developer preview of Big Sur. troubleshooting steps and install guided did not solve the issue

rrlorentzen commented 3 years ago

The problem for me went away after a recent Karabiner update but then came back after a MacOS update.

yoomlam commented 3 years ago

+1 same here using 13.3.0 on Catalina 10.15.7

huguesalary commented 3 years ago

same issue here with 13.3.0 on Catalina 10.15.7

miaachan commented 3 years ago

Same issue here with 13.3.0, 13.3.1, 13.39 on Catalina 10.15.7

miaachan commented 3 years ago

Same issue here with 13.3.0, 13.3.1, 13.39 on Catalina 10.15.7

OK, I think this is probably caused by SentinelOne (which I'm using) after reading this https://github.com/pqrs-org/Karabiner-Elements/issues/2445#issuecomment-718327064 by @tekezo

redanaheim commented 3 years ago

Same issue on macOS 11.3 (20E5172i), have tried all the steps above.

RoyTrudell commented 3 years ago

Same issue MacOS 11.4, Karabiner: 13.4.9

foxale commented 3 years ago

Same here, 11.4 no version works properly now

sokolowskip-1 commented 3 years ago

I solved this problem on my mac. You need to go Security and privacy -> general tab -> look for allow apps from external developers. There is a list of details. By allowing it on the list, log changed to: 2021-08-29 08:56:13.171] [warning] [virtual_hid_device_service] driverversion is mismatched: client expected: 10300, actual dext: std::nullopt [2021-08-29 08:56:14.171] [warning] [virtual_hid_device_service] driverversion is mismatched: client expected: 10300, actual dext: std::nullopt [2021-08-29 08:56:15.000] [info] [virtual_hid_device_service] driverversion is changed: 10300 [2021-08-29 08:56:15.000] [info] [virtual_hid_device_service] driverversion is changed: 10300 [2021-08-29 08:56:15.000] [info] [virtual_hid_device_service] io_service_client::opened [2021-08-29 08:56:15.000] [info] [virtual_hid_device_service] io_service_client::async_virtual_hid_keyboard_initialize [2021-08-29 08:56:15.000] [info] [virtual_hid_device_service] io_service_client::opened [2021-08-29 08:56:15.003] [info] [observer] matching device: [2021-08-29 08:56:15.003] [info] [observer] registry_entry_id: 4294970107 [2021-08-29 08:56:15.004] [info] [observer] manufacturer: pqrs.org [2021-08-29 08:56:15.004] [info] [observer] product: Karabiner DriverKit VirtualHIDKeyboard 1.3.0 [2021-08-29 08:56:15.004] [info] [observer] vendor_id: 5824 [2021-08-29 08:56:15.004] [info] [observer] product_id: 10203 [2021-08-29 08:56:15.004] [info] [observer] location_id: 0x0 [2021-08-29 08:56:15.004] [info] [observer] serial_number: pqrs.org:Karabiner-DriverKit-VirtualHIDKeyboard [2021-08-29 08:56:15.021] [info] [grabber] hid_event_system_monitor set_caps_lock_delay_override for pqrs.org:Karabiner-DriverKit-VirtualHIDKeyboard [2021-08-29 08:56:15.021] [info] [observer] is_keyboard: true [2021-08-29 08:56:15.023] [info] [observer] is_pointing_device: false [2021-08-29 08:56:15.023] [info] [observer] rescan devices... [2021-08-29 08:56:15.027] [info] [observer] Karabiner DriverKit VirtualHIDKeyboard 1.3.0 (device_id:4294970107) is observed. [2021-08-29 08:56:15.475] [info] [virtual_hid_device_service] virtual_hid_keyboardready is changed: true [2021-08-29 08:56:16.172] [info] [grabber] virtual_hid_device_serviceclient virtual_hid_keyboard_ready_response: true [2021-08-29 08:56:16.174] [info] [grabber] Apple Internal Keyboard / Trackpad (device_id:4294968193) is grabbed. [2021-08-29 08:56:16.174] [info] [grabber] caps_lock_led_state_manager is started: Apple Internal Keyboard / Trackpad [2021-08-29 08:56:16.174] [info] [virtual_hid_device_service] terminate_virtual_hid_pointing_io_service_client [2021-08-29 08:56:18.023] [info] [grabber] hid_event_system_monitor set_caps_lock_delay_override for pqrs.org:Karabiner-DriverKit-VirtualHIDKeyboard

And works fine form me :)

cjlacz commented 2 years ago

I was running into this problem with 14.2 on Big Sur. Downgrading to 13.7 has resolved it for me 

Ajaymamtora commented 2 years ago

same issue here, downgrading to 13.7 didn't work, on:

lucasc896 commented 2 years ago

Same here. I've removed SIP with csrutil disable, but now have an empty list for systemextensionctl list. Have tried various karabiner versions, but still get:

[2022-01-10 18:10:33.030] [warning] [virtual_hid_device_service] driver_version_ is mismatched: Karabiner-DriverKit-VirtualHIDDeviceClient expected: 10600, actual dext: std::nullopt
momomo commented 2 years ago

Have the same issue here. Big Sur, nothing is getting back the allow application thing.

mswer commented 2 years ago

Same as momomo. Was working without any trouble until I updated to 11.6.2 (20G314). Now just getting the following in the karabiner logs repeatedly

[2022-01-20 13:24:29.058] [warning] [virtual_hid_device_service] driver_version_ is mismatched: Karabiner-DriverKit-VirtualHIDDeviceClient expected: 10600, actual dext: std::nullopt

Edit to add: I've tried uninstalling with the Uninstall button in the app, restarting, and reinstalling. Issue persists.

Zehelein commented 2 years ago

Same for me - Macbook Pro M1 - Monterey 12.1 Everything worked perfectly fine until two days ago. Did try a ton of different things with rebooting in safe mode, reinstalling, going back a few versions, rebooting another few times but that Activate button never shows up.

[2022-01-21 08:07:58.410] [warning] [virtual_hid_device_service] driver_version_ is mismatched: Karabiner-DriverKit-VirtualHIDDeviceClient expected: 10600, actual dext: std::nullopt

mswer commented 2 years ago

@tekezo Any chance you've observed this issue or would be able to provide any troubleshooting suggestions? Also happy to gather any logs or do testing that if that would be helpful. Driving me nuts trying to remember to not use expected key mappings...thank you!

momomo commented 2 years ago

I am not sure, but for me I think it has to do with a corporate computer having restrictions on system kernel extensions being installed. I am not really sure. @tekezo why does the name of the third app start with a dot? I think that might potentially cause an issue. It is not really hidden since all of us are pros anyway and do not of course hide such files. For future releases perhaps bundling all of the apps into a directory in /Applications directory might be a better way of organizing.

Anyhow, I think corporate policy might be an issue for me. Perhaps you others too? I do not have an M1.

dnz-bdeboer commented 2 years ago

It seemed I had problems similar to this, but it looks random. Anyway, I deleted the existing accessibility permissions from Karabiner, granted permissions to the Karabiner-Elements.app (not sure that's need), rebooted, was then prompted I had to add permission to monitor input for karabiner_grabber/karabiner_observer, did that, and it now works.

lucasc896 commented 2 years ago

Similar to @momomo it was the restrictions that IT had placed on my system that were blocking the driver's loading. They applied an exception for this driver and now it's loaded and karabiner is running fine.

momomo commented 2 years ago

@lucasc896 Our organization has yet to include such an exemption :(

tomprats commented 2 years ago

Similar to @momomo it was the restrictions that IT had placed on my system that were blocking the driver's loading. They applied an exception for this driver and now it's loaded and karabiner is running fine.

@lucasc896 Do you know how they did that? My IT guy couldn't find how they were blocking it

lucasc896 commented 2 years ago

Not entirely sure, as I think it was based in their management software. All I know is they installed a kernel extension override for org.pqrs.Karabiner-Elements.Preferences

jgspratt commented 1 year ago

Hitting this on Ventura. Haven't found a way around, but this thread is helpful.