Only start the VirtualBox guest services if we're in a VirtualBox VM

This commit is contained in:
Eelco Dolstra 2013-10-09 13:30:57 +02:00
parent d40629ad6d
commit 3472992188

View File

@ -40,14 +40,16 @@ optionalAttrs (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) # ugly...
users.extraGroups.vboxsf.gid = config.ids.gids.vboxsf;
jobs.virtualbox =
systemd.services.virtualbox =
{ description = "VirtualBox Guest Services";
wantedBy = [ "multi-user.target" ];
requires = [ "dev-vboxguest.device" ];
after = [ "dev-vboxguest.device" ];
exec = "${kernel.virtualboxGuestAdditions}/sbin/VBoxService --foreground";
unitConfig.ConditionVirtualization = "oracle";
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/sbin/VBoxService VBoxService --foreground";
};
services.xserver.videoDrivers = mkOverride 50 [ "virtualbox" ];