I can only guess the previous BIOS wasn’t enabling every virtualization extension necessary for some applications for some reason then, given that GNOME Boxes did work. Glad you’ve found a solution.
I can only guess the previous BIOS wasn’t enabling every virtualization extension necessary for some applications for some reason then, given that GNOME Boxes did work. Glad you’ve found a solution.
I did accidentally type the relevant command incorrectly, forgetting that sudo swaps the user before subcommands like whoami will resolve. So that command attempted to add the kvm group to ‘root’ rather to your user. I have fixed the command in the relevant comment for anyone else reading this thread. You can try sudo adduser "<username>" kvm
, manually substituting <username> for your username. As normal, restart after adding the group to your user. Additionally, I have added a warning to the solution in the original comment of why you may not want to keep this solution enabled forever as well as a way to disable it later if desired.
Based on using a local installation without elevated permissions (outside of /usr/(local)), I can only guess of two things happening:
The first is GNOME Boxes asks for elevated permissions when running or otherwise uses Polkit to gain those permissions. Your user by default likely isn’t granted access to /dev/kvm and running userland software without additional permissions will inherently not allow KVM access.
To allow this sanely, you can add your user to the KVM group to allow userland KVM access. It can be done via sudo adduser "<username>" kvm
and then restarting your computer. To note, this is something that can allow any application to access virtualization without special permissions. If you don’t want this change to remain forever, the command sudo usermod -r -G kvm "<username>"
followed by a restart can revert this change.
Alternatively, installing Android Studio via the Flathub Flatpak may handle permissions without needing to modify user groups in this case.
The second (unlikely, but possible) problem is the AppArmor profile blocking KVM access for userland. I don’t have particularly any experience with creating modified profiles for AppArmor, if this is the cause. I could only offer terrible advice for AppArmor (disabling AppArmor or switching to warn-only, both things I do not recommend doing). Again, it might be worth trying to install Android Studio via flatpak to see if things work better if this is the cause.
I am testing this currently to ensure correctness, but if you’re using Android Studio via Flatpak, you may need to enable kvm permissions for the application to have hardware-accelerated VMs. This can be done using Flatseal. The relevant permission (device=kvm) is under the Device section labeled as Virtualization.
Additionally, if problems are occurring outside of Flatpak, you might need to enable certain hardware virtualization technologies from your computer’s BIOS (AMD-V, VT-x, VT-d, Intel VT, Virtualization, or some other similar term depending on CPU and motherboard).
EDIT: Doing testing, it seems the default permissions provided for Android Studio’s Flathub Flatpak includes device=all. No permissions edits are necessary by default. If there are problems with the /dev/kvm device not being reachable, it is almost certainly due to the necessary extensions not being enabled in the BIOS, or your CPU doesn’t support virtualization. Pop! OS 22.04 has the necessary components in software for KVM to function pre-installed, so nothing should be wrong on the OS side.
Superior over what exactly? Most workstation/desktop distros have a graphical software manager and handle drivers in a similar manner.
You’re not referring to this satire article by chance?