summary refs log tree commit diff
path: root/gnu/build
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-12-02 20:17:45 -0500
committerLeo Famulari <leo@famulari.name>2017-12-18 00:39:40 -0500
commit2ca712bdbae5551a270c17522da20e8cb84a29cf (patch)
tree450d0f7e32c8d4732aae316a8f27083d6cab65f6 /gnu/build
parent87dbb634a992e51fbcea86034a6c37f126a25a78 (diff)
downloadguix-2ca712bdbae5551a270c17522da20e8cb84a29cf.tar.gz
vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.
* gnu/build/vm.scm (load-in-linux-vm): Use QEMU's virtio-rng-pci.
* gnu/system/vm.scm (common-qemu-options): Likewise.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/vm.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 8f8ca609f2..404f324045 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
-;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;;
@@ -139,6 +139,8 @@ the #:references-graphs parameter of 'derivation'."
   (unless (zero?
            (apply system* qemu "-nographic" "-no-reboot"
                   "-m" (number->string memory-size)
+                  "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
+                  "-device" "virtio-rng-pci,rng=guixsd-vm-rng"
                   "-virtfs"
                   (string-append "local,id=store_dev,path="
                                  (%store-directory)