From 5747ec4eae43960053d107b41128acc88f6235c9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 24 Aug 2020 15:33:44 +0200 Subject: [PATCH] testing: Use host's /dev/urandom as /dev/random on guests via VirtIO RNG Newer versions of systemd etc. seem to require quite a lot of entropy from /dev/random while booting, which can block and therefore delay the start of other services (in particular sshd) by more than a minute. Using the host's /dev/urandom via VirtIO RNG, we can avoid blocking the guests. The required kernel options are added for kernel versions 5.4+. --- testing/config/kernel/config-5.4 | 7 ++++++- testing/config/kernel/config-5.5 | 7 ++++++- testing/config/kernel/config-5.7 | 7 ++++++- testing/config/kvm/alice.xml | 3 +++ testing/config/kvm/bob.xml | 3 +++ testing/config/kvm/carol.xml | 3 +++ testing/config/kvm/dave.xml | 3 +++ testing/config/kvm/moon.xml | 3 +++ testing/config/kvm/sun.xml | 3 +++ testing/config/kvm/winnetou.xml | 3 +++ 10 files changed, 39 insertions(+), 3 deletions(-) diff --git a/testing/config/kernel/config-5.4 b/testing/config/kernel/config-5.4 index a4a16b110..5b89e830d 100644 --- a/testing/config/kernel/config-5.4 +++ b/testing/config/kernel/config-5.4 @@ -1660,7 +1660,12 @@ CONFIG_DEVKMEM=y CONFIG_HVC_DRIVER=y CONFIG_VIRTIO_CONSOLE=y # CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +CONFIG_HW_RANDOM_INTEL=y +CONFIG_HW_RANDOM_AMD=y +# CONFIG_HW_RANDOM_VIA is not set +CONFIG_HW_RANDOM_VIRTIO=y # CONFIG_NVRAM is not set # CONFIG_APPLICOM is not set # CONFIG_MWAVE is not set diff --git a/testing/config/kernel/config-5.5 b/testing/config/kernel/config-5.5 index 38b1ef2db..9df7471c2 100644 --- a/testing/config/kernel/config-5.5 +++ b/testing/config/kernel/config-5.5 @@ -1627,7 +1627,12 @@ CONFIG_DEVKMEM=y CONFIG_HVC_DRIVER=y CONFIG_VIRTIO_CONSOLE=y # CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +CONFIG_HW_RANDOM_INTEL=y +CONFIG_HW_RANDOM_AMD=y +# CONFIG_HW_RANDOM_VIA is not set +CONFIG_HW_RANDOM_VIRTIO=y # CONFIG_NVRAM is not set # CONFIG_APPLICOM is not set # CONFIG_MWAVE is not set diff --git a/testing/config/kernel/config-5.7 b/testing/config/kernel/config-5.7 index 77a1e68d9..e1d8c5be7 100644 --- a/testing/config/kernel/config-5.7 +++ b/testing/config/kernel/config-5.7 @@ -1641,7 +1641,12 @@ CONFIG_HVC_DRIVER=y # CONFIG_SERIAL_DEV_BUS is not set CONFIG_VIRTIO_CONSOLE=y # CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +CONFIG_HW_RANDOM_INTEL=y +CONFIG_HW_RANDOM_AMD=y +# CONFIG_HW_RANDOM_VIA is not set +CONFIG_HW_RANDOM_VIRTIO=y # CONFIG_APPLICOM is not set # CONFIG_MWAVE is not set CONFIG_DEVMEM=y diff --git a/testing/config/kvm/alice.xml b/testing/config/kvm/alice.xml index c8ff289db..d2a7e032b 100644 --- a/testing/config/kvm/alice.xml +++ b/testing/config/kvm/alice.xml @@ -68,5 +68,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/bob.xml b/testing/config/kvm/bob.xml index 0b433a437..48bef7486 100644 --- a/testing/config/kvm/bob.xml +++ b/testing/config/kvm/bob.xml @@ -61,5 +61,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/carol.xml b/testing/config/kvm/carol.xml index 3eb163f6c..d7249c38c 100644 --- a/testing/config/kvm/carol.xml +++ b/testing/config/kvm/carol.xml @@ -61,5 +61,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/dave.xml b/testing/config/kvm/dave.xml index d8d05a9e9..bf070f1b1 100644 --- a/testing/config/kvm/dave.xml +++ b/testing/config/kvm/dave.xml @@ -61,5 +61,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/moon.xml b/testing/config/kvm/moon.xml index 943ab35b5..4ffaf809a 100644 --- a/testing/config/kvm/moon.xml +++ b/testing/config/kvm/moon.xml @@ -73,5 +73,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/sun.xml b/testing/config/kvm/sun.xml index 893a4aa37..2e5a382ea 100644 --- a/testing/config/kvm/sun.xml +++ b/testing/config/kvm/sun.xml @@ -73,5 +73,8 @@
+ + /dev/urandom + diff --git a/testing/config/kvm/winnetou.xml b/testing/config/kvm/winnetou.xml index 59d7184f6..3b42e38f2 100644 --- a/testing/config/kvm/winnetou.xml +++ b/testing/config/kvm/winnetou.xml @@ -66,5 +66,8 @@
+ + /dev/urandom +