Virtualbox: kernel driver not accessible

I’m trying to start a VM from the VirtualBox UI. It works in sudo, but not my regular user account.

In configuration.nix I have:

  virtualisation.virtualbox.host.enable = true;
  virtualisation.virtualbox.guest.enable = true;

and I have virtualbox in my environment.systemPackages.

in my user profile I added myself to vboxusers two ways:

  users.extraUsers.bburdette = {
     <more things>
     extraGroups = [ "wheel" "dialout" "docker" "vboxusers" ];
   };

  users.extraGroups.vboxusers.members = [ "bburdette" ];

that seems to have worked:

[bburdette@HOSS:~]$ getent group vboxusers
vboxusers:x:72:bburdette

But I still can’t start VMs from my user account. I get a dialog that says “Kernel driver not accessible”.

Help!

You may need to enable the virtualization features of your CPU in BIOS :slight_smile: Ignore me, skimmed past the first sentence.

Maybe the virtualbox in systemPackages is overriding something? You shouldn’t need to set that if it’s enabled already.

Did you logout snd re-logged in after adding your user to the group vboxusers?

1 Like

Ok problem solved! After removing virtualbox from systemPackages I still have a VirtualBox executable, and now I can boot an image without sudo. Nice! Thx for the help.

Hello

How do you remove virtualbox from systemPackages please ?

systemPackages is a section in /etc/nixos/configuration.nix. Edit that file and do

nixos-rebuild switch.