Weblog entry #56 for dkg
My current way to get around this is to replace /dev/random with the /dev/urandom device, which does not block if the entropy pool is depleted:
mknod /dev/newrandom c 1 9 chmod --reference=/dev/random /dev/newrandom mv -f /dev/newrandom /dev/randomThis has the consequence that the "randomness" these commands use doesn't have as much "real" entropy, though some operating systems (like FreeBSD) have a non-blocking /dev/random by default (and it's also questionable what "real" entropy means for a virtual machine in the first place).
I'm also using cowbuilder within these VMs to do package builds. But cowbuilder has its own /dev tree, with its own device nodes, so this needs to be fixed too. So after you have successfully done cowbuilder --create, you need to modify the random device within the cowbuilder chroot:
mknod /var/cache/pbuilder/base.cow/dev/newrandom c 1 9 chmod --reference=/var/cache/pbuilder/base.cow/dev/random /var/cache/pbuilder/base.cow/dev/newrandom mv -f /var/cache/pbuilder/base.cow/dev/newrandom /var/cache/pbuilder/base.cow/dev/randomHopefully this will be useful for other people using cowbuilder (or other build strategies) on isolated virtual machines. If you've worked around this problem in other ways (or if there's a security concern about this approach), i'd be happy to hear about the details.
Comments on this Entry
[ Parent | Reply to this comment ]
I suggest to get an entropy key (http://www.entropykey.co.uk/), plug it into the host, and use virtio_rng, as suggested by the previous commenter.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
# $Id: rng-tools.default,v 1.1.2.5 2008-06-10 19:51:37 hmh Exp $
# This is a POSIX shell fragment
# Set to the input source for random data, leave undefined
# for the initscript to attempt auto-detection. Set to /dev/null
# for the viapadlock driver.
HRNGDEVICE=/dev/urandom
# Additional options to send to rngd. See the rngd(8) manpage for
# more information. Do not specify -r/--rng-device here, use
# HRNGDEVICE for that instead.
RNGDOPTIONS="--fill-watermark=89% --feed-interval=2 --random-device=/dev/random"
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]