anchor.diff:      (set; declare -p) > saved-env
       XCHG_DIR="$(${coreutils}/bin/mktemp -d nix-vm.XXXXXXXXXX --tmpdir)"
       ${coreutils}/bin/mv saved-env "$XCHG_DIR/"
  +
  +    eval "$preVM"
  +
       QEMU_VDE_SOCKET="$(pwd)/vde.ctl"
       MONITOR_SOCKET="$(pwd)/monitor"
       ${vde2}/bin/vde_switch -s "$QEMU_VDE_SOCKET" &
  
positive.code:     quit
      CMD
      wait %-
    '';
  
  in writeScript "run-cygwin-vm.sh" ''
    #!${stdenv.shell} -e
    ${preVM}
    ${vmExec}
  ''
  
negative.code:   '' else ''
      ${vmTools.qemuProg} ${cygwinQemuArgs} &
      ${vmTools.qemuProg} ${controllerQemuArgs}${bgBoth}
    '';
  
    postVM = if suspendTo != null then ''
      while ! test -e "$XCHG_DIR/suspend_now"; do sleep 1; done
      ${socat}/bin/socat - UNIX-CONNECT:$MONITOR_SOCKET <<CMD
      stop
  