Difference between revisions of "VirtualBox"

From NixOS Wiki
Jump to: navigation, search
m
m (Replace "but on your host" by "not on your host" about guest additions installation)
 
Line 40: Line 40:
 
== VirtualBox Guest Additions ==
 
== VirtualBox Guest Additions ==
  
The Guest Additions are designed to be installed inside a virtual machine after the guest operating system has been installed [https://www.virtualbox.org/manual/ch04.html (more info)]. So you only need to enable this in your NixOS virtual machine (but on your NixOS host):
+
The Guest Additions are designed to be installed inside a virtual machine after the guest operating system has been installed [https://www.virtualbox.org/manual/ch04.html (more info)]. So you only need to enable this in your NixOS virtual machine (not on your NixOS host):
  
 
<syntaxHighlight lang=nix>
 
<syntaxHighlight lang=nix>

Latest revision as of 21:47, 14 April 2025

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

Note: This package is unfree. Read the FAQ entry to know how to use unfree packages.

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;
}
Warning: Host extensions cause frequent recompilation.

Possible solutions:

VirtualBox Guest Additions

The Guest Additions are designed to be installed inside a virtual machine after the guest operating system has been installed (more info). So you only need to enable this in your NixOS virtual machine (not on your NixOS host):

{
  virtualisation.virtualbox.guest.enable = true;
  virtualisation.virtualbox.guest.dragAndDrop = true;
}

See also