anchor.diff: -import ./make-test.nix ({ pkgs, ... }: let
  +import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
   
     testVMConfig = { config, pkgs, ... }: {
       boot.kernelParams = [
  
positive.code: 
      sharedFlags = mkFlags [
        "--name vboxshare"
        "--hostpath /home/alice/vboxshare"
      ];
    in ''
      sub ru {
        return "su - alice -c '$_[0]'";
      }
  
      sub waitForVMBoot {
        $machine->execute(ru(
          'set -e; i=0; '.
          'while ! test -e /home/alice/vboxshare/boot-done; do '.
          'sleep 10; i=$(($i + 10)); [ $i -le 3600 ]; '.
          'VBoxManage list runningvms | grep -qF test; '.
          'done'
        ));
      }
  
      sub checkRunning {
        my $checkrunning = ru "VBoxManage list runningvms | grep -qF test";
        my ($status, $out) = $machine->execute($checkrunning);
        return $status == 0;
      }
  
      sub waitForStartup {
        for (my $i = 0; $i <= 120; $i += 10) {
          $machine->sleep(10);
          return if checkRunning;
        }
        die "VirtualBox VM didn't start up within 2 minutes";
      }
  
      sub waitForShutdown {
        for (my $i = 0; $i <= 120; $i += 10) {
          $machine->sleep(10);
          return unless checkRunning;
        }
        die "VirtualBox VM didn't shut down within 2 minutes";
      }
  
      sub shutdownVM {
        $machine->succeed(ru "touch /home/alice/vboxshare/shutdown");
        $machine->waitUntilSucceeds(
          "test ! -e /home/alice/vboxshare/shutdown ".
          "  -a ! -e /home/alice/vboxshare/boot-done"
        );
        waitForShutdown;
      }
  
      sub cleanup {
        $machine->execute(ru "VBoxManage controlvm test poweroff")
          if checkRunning;
        $machine->succeed("rm -rf /home/alice/vboxshare");
        $machine->succeed("mkdir -p /home/alice/vboxshare");
        $machine->succeed("chown alice.users /home/alice/vboxshare");
      }
  
      $machine->waitForX;
  
      $machine->succeed(ru "VBoxManage createvm --name test ${createFlags}");
      $machine->succeed(ru "VBoxManage modifyvm test ${vmFlags}");
  
      $machine->fail("test -e '/root/VirtualBox VMs'");
      $machine->succeed("test -e '/home/alice/VirtualBox VMs'");
  
      $machine->succeed(ru "VBoxManage storagectl test ${controllerFlags}");
      $machine->succeed(ru "VBoxManage storageattach test ${diskFlags}");
  
      $machine->succeed(ru "VBoxManage sharedfolder add test ${sharedFlags}");
  
      $machine->succeed(ru "VBoxManage showvminfo test >&2");
  
      cleanup;
  
      subtest "virtualbox-gui", sub {
        $machine->succeed(ru "VirtualBox &");
        $machine->waitForWindow(qr/Oracle VM VirtualBox Manager/);
        $machine->sleep(5);
        $machine->screenshot("gui_manager_started");
        $machine->sendKeys("ret");
        $machine->screenshot("gui_manager_sent_startup");
        waitForStartup;
        $machine->screenshot("gui_started");
        waitForVMBoot;
        $machine->screenshot("gui_booted");
        shutdownVM;
        $machine->sleep(5);
        $machine->screenshot("gui_stopped");
        $machine->sendKeys("ctrl-q");
  
negative.code: 
      vmFlags = mkFlags [
        "--uart1 0x3F8 4"
        "--uartmode1 client /run/virtualbox-log-${name}.sock"
      ];
  
      controllerFlags = mkFlags [
  