From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: bug#31268: 'guix system vm-image' hangs Date: Tue, 22 May 2018 21:45:52 +0300 Message-ID: <20180522184552.GC1150@macbook41> References: <87604en3u5.fsf@gmail.com> <20180425223706.22d91e40@centurylink.net> <877eoua9v1.fsf@gmail.com> <87r2mxw1ax.fsf@netris.org> <87bme0ydzn.fsf@gnu.org> <87y3h4fy8c.fsf@netris.org> <87muwx9h82.fsf@lassieur.org> <87a7swrk8i.fsf@gnu.org> <87h8mz4q2g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="96YOpH+ONegL0A3E" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLCIN-0001Um-Lt for bug-guix@gnu.org; Tue, 22 May 2018 14:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLCIM-0007D8-KB for bug-guix@gnu.org; Tue, 22 May 2018 14:46:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLCIM-0007D2-EI for bug-guix@gnu.org; Tue, 22 May 2018 14:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fLCIM-0001UZ-3U for bug-guix@gnu.org; Tue, 22 May 2018 14:46:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87h8mz4q2g.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: George myglc2 Clemmer , =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , 31268@debbugs.gnu.org --96YOpH+ONegL0A3E Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2018 at 06:23:35PM +0200, Ludovic Court=C3=A8s wrote: > Hello! >=20 > (+Cc: Leo for randomness input.) >=20 > Another approach I looked at was to seed the VM=E2=80=99s PRNG from /dev/= hwrng, > which I thought was connected to the host via =E2=80=98virtio-rng-pci=E2= =80=99, but I > get ENODEV while trying to read from /dev/hwrng in the guest like this: >=20 > 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." > =20 > (set-path-environment-variable "PATH" '("bin" "sbin") inputs) > =20 > + ;; 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))) >=20 > Am I missing something, Leo? >=20 > In short, we=E2=80=99re almost done with this bug, now we just need to ma= ke sure > we have a reasonable fix. >=20 > Thanks, > Ludo=E2=80=99. >=20 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. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --96YOpH+ONegL0A3E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlsEZVsACgkQQarn3Mo9 g1EFyg//XgTJ1jEAAP7GNX25AKdEPhd14GCt97OaOmQTDWjZQ+Y5W47FycKBOpzN k9UO52Or83iu+qc4E5E9/6/8B0kRdEPkpjeZ1KhbK3mKoxc+btEj8PaqHhX9naZ2 PLS7Zarx0NeZu5DcXcopN1JqsIywvM3O6DI4lqfyjk0M7hOsnmMJ1gBLpHLfPMwB Fp65zV1RWzv0mCgA7paJCFl4UPb7E8Q++/A2gR70MMZ5kwAnWJ/FbPp9MziV8yf/ Vs6z0TpR9VtnF+bEbc1QDQ26zSwdGL5bPFgGB2fIOq9jsP3K97G13+1SBah6ALHJ s1iNrYWpyT+A5SAkmkiZ/YVTuI5k42zFPIJF7eaizAoKGSWAE1oE/gSlB5wie5hA mJSeM+p/jd/4qvanWXLuje9XNvep1zmrcn/nJSpfaYbazp3mm244DbXVIkN2beCy Ugo5I34/IZkb5DhPZhXEzyf4CUO56CAx0qRuKMFMglNsb6ucLtGEsO5E2Gyk5pg5 odzq2CzmTT+l3IirqmwvwJC9Aye6rMcACSJ0fnOc0Sap1fpPVZlFnYmUERsj9oW6 k8tFMPkagTPF9+qHSFUHr/hRcGLCBRdUbLxr3CHSpbyekMWFtigHYv2qIBsvcsiF ldT9mZH5qsBJ+DsM/h3N4zDfnYJwId8y9HD+Lqp549U+nDml5y4= =X+vF -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E--