anchor.diff:  import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
   
  -  testVMConfig = { config, pkgs, ... }: {
  -    boot.kernelParams = [
  +  testVMConfig = vmName: attrs: { config, pkgs, ... }: {
  +    boot.kernelParams = let
  +      miniInit = ''
  +        #!${pkgs.stdenv.shell} -xe
  +        export PATH="${pkgs.coreutils}/bin:${pkgs.utillinux}/bin"
  +
  +        ${pkgs.linuxPackages.virtualboxGuestAdditions}/sbin/VBoxService
  +        ${(attrs.vmScript or (const "")) pkgs}
  +
  +        i=0
  +        while [ ! -e /mnt-root/shutdown ]; do
  +          sleep 10
  +          i=$(($i + 10))
  +          [ $i -le 120 ] || fail
  +        done
  +
  +        rm -f /mnt-root/boot-done /mnt-root/shutdown
  +      '';
  +    in [
         "console=tty0" "console=ttyS0" "ignore_loglevel"
         "boot.trace" "panic=1" "boot.panic_on_fail"
  +      "init=${pkgs.writeScript "mini-init.sh" miniInit}"
       ];
   
       fileSystems."/" = {
  
positive.code:         );
          waitForShutdown_${name};
        }
  
        sub cleanup_${name} {
          $machine->execute(ru "VBoxManage controlvm ${name} poweroff")
            if checkRunning_${name};
          $machine->succeed("rm -rf ${sharePath}");
          $machine->succeed("mkdir -p ${sharePath}");
          $machine->succeed("chown alice.users ${sharePath}");
        }
      '';
    };
  
    vboxVMs.test1 = createVM "test1";
  
  in {
    name = "virtualbox";
  
negative.code:     ];
    };
  
    testVM = vmName: vmScript: let
      cfg = (import ../lib/eval-config.nix {
        system = "i686-linux";
        modules = [
          ../modules/profiles/minimal.nix
          (testVMConfig vmName vmScript)
        ];
      }).config;
    in pkgs.vmTools.runInLinuxVM (pkgs.runCommand "virtualbox-image" {
  