diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 1f4f8b35b663..0ea3e157c7e7 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -5,7 +5,7 @@ , img ? pkgs.stdenv.hostPlatform.linux-kernel.target , storeDir ? builtins.storeDir , rootModules ? - [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ] + [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "virtiofs" "crc32c_generic" ] }: let @@ -123,7 +123,7 @@ rec { echo "mounting Nix store..." mkdir -p /fs${storeDir} - mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose,msize=131072 + mount -t virtiofs store /fs${storeDir} mkdir -p /fs/tmp /fs/run /fs/var mount -t tmpfs -o "mode=1777" none /fs/tmp @@ -132,7 +132,7 @@ rec { echo "mounting host's temporary directory..." mkdir -p /fs/tmp/xchg - mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L,msize=131072 + mount -t virtiofs xchg /fs/tmp/xchg mkdir -p /fs/proc mount -t proc none /fs/proc @@ -222,8 +222,10 @@ rec { ${if (customQemu != null) then customQemu else (qemu-common.qemuBinary qemu)} \ -nographic -no-reboot \ -device virtio-rng-pci \ - -virtfs local,path=${storeDir},security_model=none,mount_tag=store \ - -virtfs local,path=xchg,security_model=none,mount_tag=xchg \ + -chardev socket,id=store,path=virtio-store.sock \ + -device vhost-user-fs-pci,chardev=store,tag=store \ + -chardev socket,id=xchg,path=virtio-xchg.sock \ + -device vhost-user-fs-pci,chardev=xchg,tag=xchg \ ''${diskImage:+-drive file=$diskImage,if=virtio,cache=unsafe,werror=report} \ -kernel ${kernel}/${img} \ -initrd ${initrd}/initrd \ @@ -259,6 +261,8 @@ rec { cat > ./run-vm <