From owner-freebsd-hackers@freebsd.org Mon Jul 13 01:15:08 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB77C999FE3 for ; Mon, 13 Jul 2015 01:15:08 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (kientzle.com [142.254.26.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53AB51EFC for ; Mon, 13 Jul 2015 01:15:07 +0000 (UTC) (envelope-from tim@kientzle.com) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id t6D1FELx086137; Mon, 13 Jul 2015 01:15:14 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.100] (192.168.1.101 [192.168.1.101]) by kientzle.com with SMTP id b4i6i3j37rx7r7vqyew9ey34rw; Mon, 13 Jul 2015 01:15:13 +0000 (UTC) (envelope-from tim@kientzle.com) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: Does /dev/random in virtual guests provide good random data? From: Tim Kientzle In-Reply-To: <55A2FB68.3070006@rawbw.com> Date: Sun, 12 Jul 2015 18:14:59 -0700 Cc: Freebsd hackers list Content-Transfer-Encoding: quoted-printable Message-Id: References: <55A2FB68.3070006@rawbw.com> To: Yuri X-Mailer: Apple Mail (2.2102) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 01:15:09 -0000 > On Jul 12, 2015, at 4:42 PM, Yuri wrote: >=20 > 'cat /dev/random' in Linux VM (tried Ubuntu and Arch) is extremely = slow, supposedly because VM runs out of entropy. This cat sometimes = stops for minutes, and usually produces very few bytes per minute. = Randomly clicking on the window helps speed it up a bit. >=20 > Same in FreeBSD VM produces steady ~28MB/s stream. >=20 > Does FreeBSD VM do something special for entropy, or the resulting = stream actually lacks entropy, or maybe Linux does something wrong? Here=E2=80=99s a good discussion of the difference between /dev/random = and /dev/urandom on Linux: http://www.2uo.de/myths-about-urandom/ In particular, it has this interesting comment: FreeBSD does the right thing: they don't have the distinction between /dev/random and /dev/urandom, both are the same device. At startup /dev/random blocks once until enough starting entropy has been gathered. Then it won't block ever again.