{ sshKey , qemuArgs ? [] , command ? "sync" , suspendTo ? null , resumeFrom ? null , installMode ? false }: let inherit (import {}) lib stdenv writeScript vmTools makeInitrd; inherit (import {}) samba vde2 busybox openssh; inherit (import {}) socat netcat coreutils gzip; preInitScript = writeScript "preinit.sh" '' #!${vmTools.initrdUtils}/bin/ash -e export PATH=${vmTools.initrdUtils}/bin mount -t proc none /proc mount -t sysfs none /sys for arg in $(cat /proc/cmdline); do if [ "x''${arg#command=}" != "x$arg" ]; then command="''${arg#command=}" fi done for i in $(cat ${modulesClosure}/insmod-list); do insmod $i done mkdir -p /tmp /dev mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/random c 1 8 mknod /dev/urandom c 1 9 mknod /dev/tty c 5 0 ifconfig lo up ifconfig eth0 up 192.168.0.2 mkdir -p /xchg /nix/store /etc /var/run /var/log cat > /etc/passwd < /etc/samba/smb.conf < '${suspendTo}'" quit CMD wait %- ''; in writeScript "run-cygwin-vm.sh" '' #!${stdenv.shell} -e ${preVM} ${vmExec} ''