Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: IOHIDDeviceOpen error: (iokit/common) not permitted #1211

Open
1 task done
aljustiet opened this issue Aug 27, 2024 · 12 comments
Open
1 task done

Bug: IOHIDDeviceOpen error: (iokit/common) not permitted #1211

aljustiet opened this issue Aug 27, 2024 · 12 comments
Assignees
Labels
bug Something isn't working macos Issue pertains to macos; jtroo has no macOS devices and does not maintain the support for this OS.

Comments

@aljustiet
Copy link

Requirements

Describe the bug

Can't run the kanata. having permission related issue
When I run:

sudo kanata --nodelay --cfg ~/Documents/mac-arch/kanata.lsp

I get:

2024-08-27T22:38:02.385497+05:00 [INFO] kanata v1.6.1 starting
2024-08-27T22:38:02.386648+05:00 [INFO] process unmapped keys: true
2024-08-27T22:38:02.387009+05:00 [INFO] NOTE: kanata was compiled to never allow cmd
2024-08-27T22:38:02.389551+05:00 [INFO] config file is valid
2024-08-27T22:38:02.389593+05:00 [INFO] entering the processing loop
2024-08-27T22:38:02.389608+05:00 [INFO] entering the event loop
2024-08-27T22:38:02.389615+05:00 [INFO] Starting kanata proper
2024-08-27T22:38:02.389618+05:00 [INFO] You may forcefully exit kanata by pressing lctl+spc+esc at any time. These keys refer to defsrc input, meaning BEFORE kanata remaps keys.
IOHIDDeviceOpen error: (iokit/common) not permitted
IOHIDDeviceOpen error: (iokit/common) not permitted
IOHIDDeviceOpen error: (iokit/common) not permitted
2024-08-27T22:38:02.404165+05:00 [ERROR] failed to open keyboard device(s): Couldn't register any device


Press enter to exit
2024-08-27T22:38:02.404174+05:00 [ERROR] channel disconnected

Relevant kanata config

https://rentry.co/4qvbsknp/raw

To Reproduce

  1. Open terminal
  2. Run kanata --cfg config.kbd
  3. Get an error

Expected behavior

Shouldn't have error

Kanata version

kanata 1.6.1

Debug logs

2024-08-27T22:48:30.251437+05:00 [INFO] kanata v1.6.1 starting
2024-08-27T22:48:30.252508+05:00 [INFO] process unmapped keys: false
2024-08-27T22:48:30.252827+05:00 [INFO] NOTE: kanata was compiled to never allow cmd
2024-08-27T22:48:30.252833+05:00 [DEBUG] (1) kanata_parser::cfg::alloc: freeing allocations of length 0
2024-08-27T22:48:30.255348+05:00 [INFO] config file is valid
2024-08-27T22:48:30.255394+05:00 [INFO] entering the processing loop
2024-08-27T22:48:30.255407+05:00 [INFO] entering the event loop
2024-08-27T22:48:30.25542+05:00 [INFO] Starting kanata proper
2024-08-27T22:48:30.255424+05:00 [INFO] You may forcefully exit kanata by pressing lctl+spc+esc at any time. These keys refer to defsrc input, meaning BEFORE kanata remaps keys.
IOHIDDeviceOpen error: (iokit/common) not permitted
IOHIDDeviceOpen error: (iokit/common) not permitted
IOHIDDeviceOpen error: (iokit/common) not permitted
2024-08-27T22:48:30.27162+05:00 [ERROR] failed to open keyboard device(s): Couldn't register any device


Press enter to exit
2024-08-27T22:48:30.271629+05:00 [ERROR] channel disconnected
2024-08-27T22:48:30.271657+05:00 [DEBUG] (2) kanata_parser::cfg::alloc: freeing allocations of length 2983

Operating system

MacOS Sonoma 14.6.1

Additional context

Installed using cargo.

@aljustiet aljustiet added the bug Something isn't working label Aug 27, 2024
@rsomani95
Copy link

rsomani95 commented Aug 31, 2024

I'm facing the same error (I'm also on macOS Sonoma 14.6.1). I installed via the binary in the Releases. I've cycled through some other issues that discuss this but none of the suggestions worked there either.

I verified that the dext part of the installation happened correctly as I can see the virtual keyboard in system settings:
CleanShot 2024-08-31 at 15 17 45@2x

Additionally, I verified the version like so:

> defaults read /Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/Info.plist CFBundleVersion
3.1.0

@Reucherian
Copy link

Reucherian commented Sep 3, 2024

This error is likely due to macOS's TCC (Transparency, Consent and Control).
Under Settings > Privacy and Security > Input Monitoring
Check if Kanata (and/or the terminal of your choice is present along with karabiner)
Screenshot 2024-09-03 at 2 10 55 PM
Adding the Kanata binary ( from ~/.cargo/bin/kanata especially if you're using it as a launch daemon) and adding your terminal to this list should solve the issue.

@rsomani95
Copy link

@Reucherian i believe i've set that up correctly. Here's what my input monitoring window looks like:

CleanShot 2024-09-03 at 15 06 37@2x

Still doesn't resolve the issue for me

@rsomani95
Copy link

I noticed you have a karabiner_observer, which I'm missing.
Is that something you added explicitly? If so, how does one go about doing it?

@Reucherian
Copy link

That is not something I added explicitly. Are you certain that kanata or the terminal application you use is on this list?
I don't see either in the screenshot.

To add a new application you can click the + button on the bottom and either drag the application to the new finder window or navigate to it using that window.

@jtroo jtroo added the macos Issue pertains to macos; jtroo has no macOS devices and does not maintain the support for this OS. label Sep 14, 2024
@Z233
Copy link

Z233 commented Oct 6, 2024

I faced the same problem and resolved it by:

  1. Adding the terminal app (in my case, iTerm) to the "Input Monitoring" list.
  2. Completely quitting Karabiner-Elements.

@sergei1152
Copy link

sergei1152 commented Nov 23, 2024

Ill add that it worked for me after adding kanata to the "Input Monitoring" list on macOS security settings. Frustrating all the hops you have to go through on macOS.

I'm now able to run kanata through launchctl with this.

My kanata is installed via homebrew so i added the /opt/homebrew/bin/kanata symlink.

image

@LeonardoMor
Copy link

Ill add that it worked for me after adding kanata to the "Input Monitoring" list on macOS security settings. Frustrating all the hops you have to go through on macOS.

I'm now able to run kanata through launchctl with this.

My kanata is installed via homebrew so i added the /opt/homebrew/bin/kanata symlink.

image

How did you do it? I have no way to browse /opt from the picker I'm presented with.

@LeonardoMor
Copy link

Nevermind. On the picker, just press G

Then type the path manually.

@nivzelber
Copy link

This happens to me as long as karabiner is open. I couldn't find a way to make both of them to work.
I guess it's related to the way they create virtual keyboards.

@makkonen
Copy link

I banged my head against this for an embarrassingly long time. I tried different versions, different paths, whitelisting everything in the Input Monitoring permissions pane... but would always get the (iokit/common) not permitted error.

Turns out that the issue was my terminal of choice (alacritty). Even when enabled on the Input Monitoring page, it doesn't have access. Running in the native terminal resolved all the issues.

I don't expect this is a common sticking point, but I thought I ought to mention it anyway, in case I save someone else a few minutes (or hours) of frustration.

@aberezin-fti
Copy link

Cant use Karabiner proper with Katana because, it seems from Karabiner logs, that Karabiner already sees the socket create by katana to talk to the Karabiner-DriverKit-VirtualHIDDevice and so gives up. Im not sure I anyone has hacked the karabiner code to try to just create another socket and see if that works. I might do that or I might just pull the plug on Karabiner proper and remap all my karabiner mappings to katana.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macos Issue pertains to macos; jtroo has no macOS devices and does not maintain the support for this OS.
Projects
None yet
Development

No branches or pull requests

10 participants