Does /dev/random in virtual guests provide good random data?

Tim Kientzle tim at kientzle.com
Mon Jul 13 01:15:09 UTC 2015


> On Jul 12, 2015, at 4:42 PM, Yuri <yuri at rawbw.com> wrote:
> 
> '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.
> 
> Same in FreeBSD VM produces steady ~28MB/s stream.
> 
> Does FreeBSD VM do something special for entropy, or the resulting stream actually lacks entropy, or maybe Linux does something wrong?

Here’s 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.



More information about the freebsd-hackers mailing list