Attach Host /dev/random to container /dev/random


I’m currently working on a certificate management system and it requires a lot of entropy which isn’t generated at high enough speed in the container. So I wonder if it is possible to use the host systems /dev/random in the container instead of the containers own?

Best regards,

There is no such thing as the container’s own /dev/random.

/dev/random in the container is already the exact same as /dev/random on the host.


Thanks for asking this, it has made me understand that I had not set high enough the -w parameter in /etc/default/haveged in my hosts running LXD. By default haveged use a value appropriate for one server (1024 for Ubuntu 16/18) and when using containers there are really more ‘servers’ that can run in a single host, all sharing some parameters including entropy. And that’s the only way to address this problem really.

1 Like

Thank you for clarifying that!

I had a realtime bug that manifested itself in the container… unlucky debugging so to speak!

Thanks again! :slight_smile: