VirtualBox: Difference between revisions
imported>Kravemir No edit summary |
imported>Alizter Add tip about changing audio driver |
||
Line 9: | Line 9: | ||
Adding users to the group vboxusers allows them to use the virtualbox functionality. | Adding users to the group vboxusers allows them to use the virtualbox functionality. | ||
{{Evaluate}} | {{Evaluate}} | ||
{{Tip|When starting a VM, you may run into NS_ERROR_FAILURE. If you check the log you might see something like | |||
<syntaxHighlight lang=nix> | |||
00:00:00.616892 Audio: Initializing ALSA driver | |||
</syntaxHighlight> | |||
In this case, the audio driver causes a crash. This can be fixed by switching to another driver such as PULSE.}} | |||
== VirtualBox Oracle Extensions == | == VirtualBox Oracle Extensions == |
Revision as of 03:23, 30 March 2023
NixOS Installation
VirtualBox can be installed on NixOS without problems, put this snippet in your configuration.nix
{
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" ];
}
Adding users to the group vboxusers allows them to use the virtualbox functionality.
VirtualBox Oracle Extensions
Oracle VirtualBox Extensions are required if you want to forward usb2 or usb3 to your guests. The Extensions are unfree.
{
nixpkgs.config.allowUnfree = true;
virtualisation.virtualbox.host.enable = true;
virtualisation.virtualbox.host.enableExtensionPack = true;
}
Possible solutions:
- Use a pinned vbox module, see how to pin: https://github.com/NixOS/nixpkgs/issues/41212
- Also see https://stackoverflow.com/questions/48838411/install-virtualbox-modules-from-nixos-unstable-in-configuration-nix
- Use module from https://github.com/NixOS/nixpkgs/pull/71127 (unsafe) if you'd like to avoid recompilation.
VirtualBox Guest Additions
{
virtualisation.virtualbox.guest.enable = true;
virtualisation.virtualbox.guest.x11 = true;
}