CentOS7 qemu VM Stuck After Configured

Ok, so after a couple of hours I found the issue. By default RedHat based systems do not setup ssh during installation by default. One must add the inst.sshd boot option which:

inst.sshd
Starts the sshd service during the installation, which allows you to connect to the system during the installation using SSH and monitor its progress. For more information on SSH, see the ssh(1) man page and the corresponding chapter in the Red Hat Enterprise Linux 7 System Administrator’s Guide. By default, sshd is only automatically started on IBM Z, and on other architectures, sshd is not started unless the inst.sshd option is used.

After updating my boot_command like this:

"boot_command": [
          "<tab> inst.sshd inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `ks_file`}}<enter><wait>"
        ],

Packer was able to ssh in. But, it connects prematurely and doesn’t give the installation a chance to complete…

So, I’m testing with enabling ssh during the %post phase in the kickstart file, acting as a sort of latch for Packer to ssh in.

Post installation tasks

%post
mv /etc/ssh/sshd_config.anaconda /etc/ssh/sshd_config
systemctl start sshd
%end

This was a fun one :stuck_out_tongue_winking_eye:

1 Like