This page describes how to run VirtualBox on NixOS.

Contents

edit Enabling VirtualBox

Add the following to your configuration.nix:

require = [ <nixos/modules/programs/virtualbox.nix> ];

Then run:

$ nixos-rebuild switch

VirtualBox is only available to users in the vboxusers group. So to enable VirtualBox for user alice, do:

$ usermod -a -G vboxusers alice

edit Running VirtualBox

Just do:

$ VirtualBox

edit Error messages

edit Missing kernel modules

If you get this error message (like this), something went wrong:

/dev/vboxdrv does not exist. Load the kernel module then try again.