From f833382298308e01fae7e5a7a83375aa087d9958 Mon Sep 17 00:00:00 2001 From: materus Date: Sat, 13 Jul 2024 23:53:37 +0200 Subject: [PATCH] materusPC: use qcow2 again --- configurations/host/materusPC/vm/win10/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configurations/host/materusPC/vm/win10/default.nix b/configurations/host/materusPC/vm/win10/default.nix index b741187..3bf167c 100644 --- a/configurations/host/materusPC/vm/win10/default.nix +++ b/configurations/host/materusPC/vm/win10/default.nix @@ -184,13 +184,15 @@ in serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; script = '' - - losetup -P /dev/loop6 /materus/data/VM/data.raw - mount /dev/loop6p1 /materus/data/Windows -o uid=1000,gid=100 + modprobe nbd max_part=16 + sleep 1 + qemu-nbd -c /dev/nbd10 /materus/data/VM/data.qcow2 --discard=unmap + sleep 1 + mount /dev/nbd10p1 /materus/data/Windows -o uid=1000,gid=100 ''; preStop = '' - umount -lf /materus/data/Windows - losetup -d /dev/loop6 + umount -r /dev/nbd10p1 + qemu-nbd -d /dev/nbd10 ''; }; }