Skip to content

Instantly share code, notes, and snippets.

@jaka
Created July 29, 2019 14:17
Show Gist options
  • Save jaka/989decf81918b6b7634a22d7f613f957 to your computer and use it in GitHub Desktop.
Save jaka/989decf81918b6b7634a22d7f613f957 to your computer and use it in GitHub Desktop.
Slow SSH startup in Debian Buster

After upgrading to a recent kernel, eg. 5.2.4, starting of SSH service at system startup (boot) was failing, and succeed after some time: greater rhen 1 minute.

After looking at dmesg SSH managed to start after crng init done.

# dmesg |grep random
[    0.185244] random: get_random_u32 called from 0xffffffff811ff3f4 with crng_init=0
[    0.599283] random: fast init done
[    0.716647] random: systemd: uninitialized urandom read (16 bytes read)
[    0.717253] random: systemd: uninitialized urandom read (16 bytes read)
[    0.717344] random: systemd: uninitialized urandom read (16 bytes read)
[  225.292239] random: crng init done
[  225.292241] random: 7 urandom warning(s) missed due to ratelimiting

Then I added to KVM xml file.

<rng model='virtio'>
      <rate bytes='192' period='300000'/>
      <backend model='random'>/dev/random</backend>
</rng>

After reboot things got better.

# dmesg |grep random
[    0.302670] random: get_random_u32 called from 0xffffffff811ff3f4 with crng_init=0
[    0.770014] random: fast init done
[    0.824357] random: crng init done```
#cat /sys/devices/virtual/misc/hw_random/rng_available 
virtio_rng.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment