Improve the vboxnet0 service
This commit is contained in:
@@ -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.
|
# Since we lack the right setuid binaries, set up a host-only network by default.
|
||||||
|
|
||||||
jobs."vboxnet0" =
|
systemd.services."vboxnet0" =
|
||||||
{ description = "VirtualBox vboxnet0 Interface";
|
{ description = "VirtualBox vboxnet0 Interface";
|
||||||
requires = [ "dev-vboxnetctl.device" ];
|
requires = [ "dev-vboxnetctl.device" ];
|
||||||
after = [ "dev-vboxnetctl.device" ];
|
after = [ "dev-vboxnetctl.device" ];
|
||||||
wantedBy = [ "network.target" "sys-subsystem-net-devices-vboxnet0.device" ];
|
wantedBy = [ "network.target" "sys-subsystem-net-devices-vboxnet0.device" ];
|
||||||
path = [ virtualbox ];
|
path = [ virtualbox ];
|
||||||
preStart =
|
serviceConfig.RemainAfterExit = true;
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script =
|
||||||
''
|
''
|
||||||
if ! [ -e /sys/class/net/vboxnet0 ]; then
|
if ! [ -e /sys/class/net/vboxnet0 ]; then
|
||||||
VBoxManage hostonlyif create
|
VBoxManage hostonlyif create
|
||||||
|
|||||||
Reference in New Issue
Block a user