From fedf13e6cfb94bad00df71aba66f0b6fea233e0f Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 16 Feb 2014 03:19:40 +0100 Subject: [PATCH] vm/windows: Implement and use "xchg" share. This now finally introduces our xchg share and also uses it for exchanging state while suspending a VM. However, accessing the _real_ Nix store still isn't possible because we're shadowing the directory in the initrd. Signed-off-by: aszlig --- .../vm/windows/controller/default.nix | 30 +++++++++++++++---- pkgs/build-support/vm/windows/default.nix | 3 ++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/vm/windows/controller/default.nix b/pkgs/build-support/vm/windows/controller/default.nix index 6abf87f82c8..da3be51c102 100644 --- a/pkgs/build-support/vm/windows/controller/default.nix +++ b/pkgs/build-support/vm/windows/controller/default.nix @@ -36,13 +36,17 @@ let ifconfig lo up ifconfig eth0 up 192.168.0.2 - mkdir -p /nix/store /etc /var/run /var/log + mkdir -p /xchg /nix/store /etc /var/run /var/log cat > /etc/passwd < '${suspendTo}'" quit CMD - wait %% + wait %- ''; in writeScript "run-cygwin-vm.sh" '' diff --git a/pkgs/build-support/vm/windows/default.nix b/pkgs/build-support/vm/windows/default.nix index b7c18f6d16c..89acb9a2d68 100644 --- a/pkgs/build-support/vm/windows/default.nix +++ b/pkgs/build-support/vm/windows/default.nix @@ -21,8 +21,11 @@ let "set -e" "net config server /autodisconnect:-1" "net use S: '\\\\192.168.0.2\\nixstore' /persistent:yes" + "net use X: '\\\\192.168.0.2\\xchg' /persistent:yes" "mkdir -p /nix/store" "mount -o bind /cygdrive/s /nix/store" + "mkdir -p /tmp/xchg" + "mount -o bind /cygdrive/x /tmp/xchg" ]; suspendTo = "state.gz"; };