I installed two ArchLinux virtual machines on my CentOS server with virt-manager on KVM. The ip addresses are 192.168.1.138 and 192.168.1.183. After installation, I installed OpenSSH and copied the SSH Keys. I tried logging in and was successful.
Then I rebooted the virtual machines and started them with virsh commands. That's when I got "Connection refused" error when I tried to log in using ssh. Pinging the VMs shows the networks is working fine.
255 hans@archie ~ % ssh root@arch1
ssh: connect to host arch1 port 22: Connection refused
hans@archie ~ % ssh -vv root@arch1
OpenSSH_7.8p1, OpenSSL 1.1.1 11 Sep 2018
debug1: Reading configuration data /home/hans/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "arch1" port 22
debug2: ssh_connect_direct
debug1: Connecting to arch1 [10.20.60.138] port 22.
debug1: connect to address 10.20.60.138 port 22: Connection refused
ssh: connect to host arch1 port 22: Connection refused
255 hans@archie ~ % ping arch1
PING arch1 (10.20.60.138) 56(84) bytes of data.
64 bytes from arch1 (10.20.60.138): icmp_seq=1 ttl=64 time=0.286 ms
64 bytes from arch1 (10.20.60.138): icmp_seq=2 ttl=64 time=0.288 ms
64 bytes from arch1 (10.20.60.138): icmp_seq=3 ttl=64 time=0.292 ms
The wired thing is if I "OPEN" the virtual machines on virt-manager and login there, then I can ssh to the VMs.
SSH keys worked fine on my 2 other CentOS servers, and the ip addresses are respectively: 192.168.1.101 and 192.168.1.202.