The cloud images from https://cloud.centos.org/centos/7/images/ contain a /etc/resolv.conf
with a spurious nameserver 10.0.2.3
entry. According to the anaconda log, this was set by DHCP during the building of the image. For most users, this entry doesn't corresponed to an existing nameserver and will slow down ssh connections, since inverse name lookups have to time out on the spurious server.
This can be fixed using virt-sysprep
from libguestfs, e.g.:
virt-sysprep -a CentOS-7-x86_64-GenericCloud-1809.qcow2 --delete '/etc/resolv.conf'
You probably also want to disable the GSSAPI authentication in ssh connections, as this is another item that can cause delays opening ssh connections. The full command for that is
virt-sysprep -a CentOS-7-x86_64-GenericCloud-1809.qcow2 --delete '/etc/resolv.conf' --edit '/etc/ssh/sshd_config:s/^GSS/# GSS/'
Besides this,virt-sysprep
will perform other types of cleanup, too, like the removal of log files from the installation.
For more information about virt-sysprep
, consult the virt-sysprep man page.
On debian and ubuntu, you have to install the libguestfs-tools
package. On CentOS 7, you have to install libguestfs-tools-c
.