Skip to content

Entropy starvation at boot, in virtual machines and containers

Entropy starvation happens when a system needs randomness before its sources have produced enough — most commonly at first boot on embedded devices, in freshly cloned virtual machines, and in containers that inherit a host state. The usual workarounds trade the problem for a weaker one.

Why it happens at boot

A kernel accumulates entropy from timing variation: interrupts, device activity, user input. At first boot on an embedded device none of that has happened yet. There is no disk activity worth measuring, no user, and often no network.

That is precisely when many devices generate their identity keys. The result is the failure mode behind the shared-factor surveys: devices generating keys from a nearly identical starting state.

Virtual machines and containers

A VM cloned from an image starts with the image's entropy state. Two clones from the same image begin identically, and the timing variation that would normally differentiate them is reduced by virtualisation.

Containers are worse in one respect: they share the host kernel and therefore the host's entropy pool, so a container has no independent entropy state at all and inherits whatever the host provides.

The workarounds, and what each costs

  • Seeding from a saved file. Store entropy at shutdown, restore at boot. Effective, and it fails exactly where it matters: first boot, where there is no saved file, and cloned images, where every clone restores the same one.
  • Entropy-gathering daemons. Feed the pool from system measurements. This raises the pool's estimate without necessarily raising its unpredictability, which is the more dangerous outcome — the system now believes it is well seeded.
  • Host-provided randomness. A paravirtual device passing entropy from the host. Sound, and it moves the trust boundary to the hypervisor.
  • Blocking until seeded. Correct, and unpopular, because it turns a silent security failure into a visible availability one.

The straightforward fix

A hardware entropy source in the device removes the dependency on accumulated timing variation. It is available at first boot, in a clone, and in a container, because it does not depend on system history.

That is the availability argument for local generation, and it is the one systems engineers find most immediately convincing — the full comparison is here.