On Tue, May 22, 2018 at 06:23:35PM +0200, Ludovic Courtès wrote: > Hello! > > (+Cc: Leo for randomness input.) > > Another approach I looked at was to seed the VM’s PRNG from /dev/hwrng, > which I thought was connected to the host via ‘virtio-rng-pci’, but I > get ENODEV while trying to read from /dev/hwrng in the guest like this: > > diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm > index b6561dfc7..3bfd6b4ca 100644 > --- a/gnu/system/vm.scm > +++ b/gnu/system/vm.scm > @@ -319,6 +319,18 @@ the image." > > (set-path-environment-variable "PATH" '("bin" "sbin") inputs) > > + ;; Try writing from /dev/hwrng into /dev/urandom. > + ;; It seems that the file /dev/hwrng always exists, even > + ;; when there is no hardware random number generator > + ;; available. So, we handle a failed read or any other error > + ;; reported by the operating system. > + (let ((buf (call-with-input-file "/dev/hwrng" > + (lambda (hwrng) > + (get-bytevector-n hwrng 512))))) > + (call-with-output-file "/dev/urandom" > + (lambda (urandom) > + (put-bytevector urandom buf)))) > + > (let* ((graphs '#$(match inputs > (((names . _) ...) > names))) > > Am I missing something, Leo? > > In short, we’re almost done with this bug, now we just need to make sure > we have a reasonable fix. > > Thanks, > Ludo’. > I can confirm that on the aarch64 machines I've tested there is a /dev/hwrng. Another option for entropy is haveged. http://issihosts.com/haveged/ It's not very actively maintained, but it is used by other distros for randomness on headless machines. -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted