gsauthof/dracut-sshd

SSHD not starting on CentOS 8 VM?

konstantinblaesi opened this issue · 3 comments

Description

I am booting a CentOS 8 via KVM / virt-manager with kernel options rd.neednet=1 ip=dhcp

Expected behavior

I can login via ssh to enter the password

Observed behavior

Connection on port 22 is refused
( implying that the network setup via dhcp works fine right? )

Additioal Information

If I add rd.break to the cmdline, enter the LUKS password using virt-manager I get dropped to the dracut rescue shell and I can connect via ssh. This is still the initramfs sshd right?

Do you have some tips how to debug this?

Is this some entropy issue? If I just start typing at the local LUKS password prompt without even submitting the password, the sshd server is availble shortly after. If I don't do anything even after 1m30s there's still no sshd server availble.
I am checking port 22 of my VM using while [ true ] ; do sudo nmap -sS -p 22 192.168.122.178 | grep "22/tcp"; done

Problem seems to be entropy related!
cat /proc/sys/kernel/random/entropy_avail prints

  • Host: 3795
  • Guest: 424 (after dropping emergency shell via rd.break)

After adding the RNG to the VM the sshd came up pretty instant :)

random

Yeah, not having enough entropy is a common thing when testing such stuff in a VM.

This is also the reason why the qemu call in the test-suite has -device virtio-rng-pci set.

Depending on the host even the entropy of the host system might run out.

If this happens in a test environment I start haveged (on the VM host, not inside the VM).