diff options
author | Данило Глинський (Danylo Hlynskyi) <abcz2.uprola@gmail.com> | 2016-09-01 18:54:58 +0000 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-09-01 20:54:58 +0200 |
commit | 78cd9f8ebc36a387fc75ebb03317707a283f43a4 (patch) | |
tree | 6d0f0df64ccb9ed03cdc68339b04e5f3980238ca /nixos | |
parent | 8a7afae58b55bbb51dd11d610c72cdc2b4142931 (diff) | |
download | nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar.gz nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar.bz2 nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar.lz nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar.xz nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.tar.zst nixlib-78cd9f8ebc36a387fc75ebb03317707a283f43a4.zip |
virtualbox: add headless build (without Qt dependency) (#18026)
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/virtualbox-host.nix | 11 | ||||
-rw-r--r-- | nixos/tests/virtualbox.nix | 11 |
2 files changed, 21 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/virtualbox-host.nix b/nixos/modules/virtualisation/virtualbox-host.nix index 5fb472ebfc32..ce4abecd6762 100644 --- a/nixos/modules/virtualisation/virtualbox-host.nix +++ b/nixos/modules/virtualisation/virtualbox-host.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.virtualisation.virtualbox.host; virtualbox = config.boot.kernelPackages.virtualbox.override { - inherit (cfg) enableHardening; + inherit (cfg) enableHardening headless; }; in @@ -47,6 +47,15 @@ in </para></important> ''; }; + + headless = mkOption { + type = types.bool; + default = false; + description = '' + Use VirtualBox installation without GUI and Qt dependency. Useful to enable on servers + and when virtual machines are controlled only via SSH. + ''; + }; }; config = mkIf cfg.enable (mkMerge [{ diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix index e85ff2380893..ab4d46ab7e15 100644 --- a/nixos/tests/virtualbox.nix +++ b/nixos/tests/virtualbox.nix @@ -314,6 +314,9 @@ let test2.vmFlags = hostonlyVMFlags; test2.vmScript = dhcpScript; + + headless.virtualisation.virtualbox.headless = true; + headless.services.xserver.enable = false; }; mkVBoxTest = name: testScript: makeTest { @@ -402,6 +405,14 @@ in mapAttrs mkVBoxTest { shutdownVM_simple; ''; + headless = '' + createVM_headless; + $machine->succeed(ru("VBoxHeadless --startvm headless & disown %1")); + waitForStartup_headless; + waitForVMBoot_headless; + shutdownVM_headless; + ''; + host-usb-permissions = '' my $userUSB = removeUUIDs vbm("list usbhost"); print STDERR $userUSB; |