diff options
author | Florian Klink <flokli@flokli.de> | 2019-10-26 00:45:42 +0200 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2019-10-26 00:45:42 +0200 |
commit | 32fd88726b7e43fbe65f93966bdd54f3d2ed10f5 (patch) | |
tree | 5d7c9722be21176d55129e3f608e83bb87a51014 /nixos/modules/virtualisation/virtualbox-host.nix | |
parent | c3098d182dc322c44fdfcceae2fdca2ef55d23ee (diff) | |
download | nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar.gz nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar.bz2 nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar.lz nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar.xz nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.tar.zst nixpkgs-32fd88726b7e43fbe65f93966bdd54f3d2ed10f5.zip |
nixos/virtualbox: fix systemd-networkd-wait-online.service waiting for vboxnet0
While switching NixOS configurations with both networking.useNetworkd = true; virtualisation.virtualbox.host.enable; You often end up waiting for systemd-networkd-wait-online.service. This happens because the vboxnet0 device doesn't have a carrier until virtualbox machines are started, so networkd gets stuck in "Configuring": ⇒ networkctl list IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 wlp2s0 wlan routable unmanaged 3 vboxnet0 ether no-carrier configuring This updates the NixOS virtualbox host module to include a RequiredForOnline=no statement in the generated 40-vboxnet0.network file, so networkd doesn't consider it necessary for systemd-networkd-wait-online.service to finish.
Diffstat (limited to 'nixos/modules/virtualisation/virtualbox-host.nix')
-rw-r--r-- | nixos/modules/virtualisation/virtualbox-host.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/virtualbox-host.nix b/nixos/modules/virtualisation/virtualbox-host.nix index 6081d4153a6..ddb0a7bda4f 100644 --- a/nixos/modules/virtualisation/virtualbox-host.nix +++ b/nixos/modules/virtualisation/virtualbox-host.nix @@ -149,5 +149,12 @@ in # Make sure NetworkManager won't assume this interface being up # means we have internet access. networking.networkmanager.unmanaged = ["vboxnet0"]; - })]); + }) (mkIf config.networking.useNetworkd { + systemd.network.networks."40-vboxnet0".extraConfig = '' + [Link] + RequiredForOnline=no + ''; + }) + +]); } |