[Nix-dev] virtualbox VBoxService/modules

David Brown nix at davidb.org
Sun May 9 22:13:54 CEST 2010


I'd like to update the Wiki to describe how to auto-start the
virtualbox guest addon modules and daemon, but wanted to get any
feedback before editing it.  The updates I've made are below.  These
are just the things I've added for this support.

Should this support be instead added to the virtualbox module so it
can just be enabled?

{ config, pkgs, ... }:
let
   modprobe = config.system.sbin.modprobe;
in
{
   boot.extraModulePackages = [
     config.boot.kernelPackages.virtualboxGuestAdditions
   ];

   environment.systemPackages = [
     config.boot.kernelPackages.virtualboxGuestAdditions
   ];

   jobs.vbox = {
     description = "Start/stop the virtual box system daemon";
     name = "vbox";
     preStart = ''
       # Load the VBox modules.
       # 'vboxvfs' seems to not work.
       for mod in vboxguest vboxvideo; do
         ${modprobe}/sbin/modprobe $mod || true
       done
     '';
     exec = "${config.boot.kernelPackages.virtualboxGuestAdditions}/sbin/VBoxService -f";
     startOn = "started udev";
   };
}

David



More information about the nix-dev mailing list