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
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to