diff --git a/pkgs/build-support/vm/windows/controller/default.nix b/pkgs/build-support/vm/windows/controller/default.nix index 3d763468113..60ec1d4783a 100644 --- a/pkgs/build-support/vm/windows/controller/default.nix +++ b/pkgs/build-support/vm/windows/controller/default.nix @@ -8,8 +8,7 @@ let inherit (import {}) lib stdenv writeScript vmTools makeInitrd; - inherit (import {}) samba vde2 busybox openssh; - inherit (import {}) socat netcat coreutils gzip; + inherit (import {}) samba vde2 openssh socat netcat coreutils gzip; preInitScript = writeScript "preinit.sh" '' #!${vmTools.initrdUtils}/bin/ash -e @@ -26,7 +25,9 @@ let insmod $i done - mkdir -p /tmp /dev + mkdir -p /dev /fs + + mount -t tmpfs none /dev mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/random c 1 8 @@ -36,22 +37,31 @@ let ifconfig lo up ifconfig eth0 up 192.168.0.2 - mkdir -p /xchg /nix/store /etc /var/run /var/log + mount -t tmpfs none /fs + mkdir -p /fs/nix/store /fs/xchg /fs/dev /fs/sys /fs/proc /fs/etc /fs/tmp - cat > /etc/passwd < /fs/etc/passwd < /fs/xchg/in-vm-exit - mount -t 9p \ - -o trans=virtio,version=9p2000.L,msize=262144,cache=loose \ - store /nix/store - - exec "$command" + poweroff -f ''; initrd = makeInitrd { @@ -80,7 +90,8 @@ let # Loop forever, because this VM is going to be killed. ${loopForever} '' else '' - ${coreutils}/bin/mkdir -p /etc/samba /etc/samba/private /var/lib/samba + ${coreutils}/bin/mkdir -p /etc/samba /etc/samba/private \ + /var/lib/samba /var/log /var/run ${coreutils}/bin/cat > /etc/samba/smb.conf <