From 596a7cbb6d760d2ea1850d903f85011b61039332 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 9 Oct 2013 19:33:12 +0200 Subject: [PATCH] Improve the vboxnet0 service --- modules/programs/virtualbox.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/virtualbox.nix b/modules/programs/virtualbox.nix index 2a2ca745e2f9..340fec0496ae 100644 --- a/modules/programs/virtualbox.nix +++ b/modules/programs/virtualbox.nix @@ -23,13 +23,15 @@ let virtualbox = config.boot.kernelPackages.virtualbox; in # Since we lack the right setuid binaries, set up a host-only network by default. - jobs."vboxnet0" = + systemd.services."vboxnet0" = { description = "VirtualBox vboxnet0 Interface"; requires = [ "dev-vboxnetctl.device" ]; after = [ "dev-vboxnetctl.device" ]; wantedBy = [ "network.target" "sys-subsystem-net-devices-vboxnet0.device" ]; path = [ virtualbox ]; - preStart = + serviceConfig.RemainAfterExit = true; + serviceConfig.Type = "oneshot"; + script = '' if ! [ -e /sys/class/net/vboxnet0 ]; then VBoxManage hostonlyif create