[GH-ISSUE #3008] KVM on Android Studio #1884

Closed
opened 2026-05-05 08:33:09 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @saddy001 on GitHub (Oct 22, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3008

Android Studio throws permission denied on /dev/kvm. From the jail, here are the permissions:

ls -hla /dev/kvm 
crw-rw---- 1 nobody nogroup 10, 232 Okt 22 12:10 /dev/kvm

Outer permission is

ls -hla /dev/kvm
crw-rw---- 1 root kvm 10, 232 Okt 22 13:18 /dev/kvm

If we make it chown user:user from the outside, it works shortly but then the ownership changes itself (on start/use of the VM) again into the above. Also the VM crashes on some actions where it does not in normal use.
Is there any quick workaround?

Originally created by @saddy001 on GitHub (Oct 22, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/3008 Android Studio throws permission denied on /dev/kvm. From the jail, here are the permissions: ``` ls -hla /dev/kvm crw-rw---- 1 nobody nogroup 10, 232 Okt 22 12:10 /dev/kvm ``` Outer permission is ``` ls -hla /dev/kvm crw-rw---- 1 root kvm 10, 232 Okt 22 13:18 /dev/kvm ``` If we make it chown user:user from the outside, it works shortly but then the ownership changes itself (on start/use of the VM) again into the above. Also the VM crashes on some actions where it does not in normal use. Is there any quick workaround?
gitea-mirror 2026-05-05 08:33:09 -06:00
Author
Owner

@Vincent43 commented on GitHub (Oct 22, 2019):

Try firejail --ignore=noroot android-studio (or whatever this app is named). You may need to also drop nogroups.

<!-- gh-comment-id:545091130 --> @Vincent43 commented on GitHub (Oct 22, 2019): Try `firejail --ignore=noroot android-studio` (or whatever this app is named). You may need to also drop `nogroups`.
Author
Owner

@saddy001 commented on GitHub (Oct 23, 2019):

Thanks, in combination that helped. It might be useful to update the android_studio profile.

<!-- gh-comment-id:545522139 --> @saddy001 commented on GitHub (Oct 23, 2019): Thanks, in combination that helped. It might be useful to update the android_studio profile.
Author
Owner

@Vincent43 commented on GitHub (Oct 23, 2019):

Theoretically on a modern distro access to /dev/kvm should be granted for logged in user through logind. In such case the profile should work out of the box. We use noroot + nogroups for qemu and there were no complaints about that.

@saddy001 what distro do you use? Could you try adding: /etc/udev/rules.d/99-kvm.rules file with:
SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess" line inside then reboot and try again with default profile?

<!-- gh-comment-id:545562671 --> @Vincent43 commented on GitHub (Oct 23, 2019): Theoretically on a modern distro access to `/dev/kvm` should be granted for logged in user through logind. In such case the profile should work out of the box. We use `noroot` + `nogroups` for [qemu](https://github.com/netblue30/firejail/blob/master/etc/qemu-system-x86_64.profile) and there were no complaints about that. @saddy001 what distro do you use? Could you try adding: `/etc/udev/rules.d/99-kvm.rules` file with: `SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess"` line inside then reboot and try again with default profile?
Author
Owner

@saddy001 commented on GitHub (Oct 24, 2019):

It's Ubuntu 18.04.3. The kvm.rules are also working, but even better, because the VM doesn't warn about missing group memberships.

<!-- gh-comment-id:545840782 --> @saddy001 commented on GitHub (Oct 24, 2019): It's Ubuntu 18.04.3. The kvm.rules are also working, but even better, because the VM doesn't warn about missing group memberships.
Author
Owner

@Vincent43 commented on GitHub (Oct 26, 2019):

I checked that on Ubuntu 19.10 /dev/kvm is accessible through uaccess by default. I think we can leave this as is and recommend users of older distros above workaround.

<!-- gh-comment-id:546617726 --> @Vincent43 commented on GitHub (Oct 26, 2019): I checked that on Ubuntu 19.10 `/dev/kvm` is accessible through `uaccess` by default. I think we can leave this as is and recommend users of older distros above workaround.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1884
No description provided.