Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
nixos/qemu-vm: Always add a virtio RNG device to the quest
Browse files Browse the repository at this point in the history
mke2fs has this annoying property that it uses getrandom() to get random
numbers (for whatever purposes) which blocks until the kernel's secure
RNG has sufficient entropy, which it usually doesn't in the early boot
(except if your CPU supports RDRAND) where we may need to create the
root disk.

So let's give the VM a virtio RNG to avoid the boot getting stuck at
mke2fs.
  • Loading branch information
dezgeg committed Apr 28, 2018
1 parent 6078f01 commit dda74d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/virtualisation/qemu-vm.nix
Expand Up @@ -77,6 +77,7 @@ let
-name ${vmName} \
-m ${toString config.virtualisation.memorySize} \
-smp ${toString config.virtualisation.cores} \
-device virtio-rng-pci \
${concatStringsSep " " config.virtualisation.qemu.networkingOptions} \
-virtfs local,path=/nix/store,security_model=none,mount_tag=store \
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
Expand Down

0 comments on commit dda74d9

Please sign in to comment.