Ansible VM cannot connect via SSH

Dear all,

I am trying to set up the lab for ansible. I’ve used the osboxes.org centos VM and I have both VM’s controller and target1 but cannot ssh to them from my windows host.
I ve tried the bridged mode, nat mode and the nat with 2nd adapter bridged mode.
virbr0 is the only one getting an ip, and the same for all vms: 192.168.122.1
Please let me know how to proceed with setting up the ssh connectivity. (sshd is running)

Hello, @msgeek
Which centos image you downloaded?

I downloaded CentOS 8.2

Hi msgeek,

1st of try to ping eachother IP’s & check do you able to telenet ssh. once this done you can copy the ssh to server.

try and let us know

Hello nitin, the VM’s get the same ip. And under /etc/sysconfig/network-scripts there is only the file ifcfg-enp0s3

indeed there will be just one file. but did you check by ping & telnet. kindly share screenshot

there is no connectivity between host and VM.
Here are the screenshots from the VM cfg



Guest addition ports should be different for ssh… Please check

what do you mean by that? VM is listening by default on port 22

But it’s a VMWare image.


It should be VirtualBox image.

hmm yes, I didn’t notice that, but I did download the 7.9-2009 64bit version and I have the exact same issue, with the bridging option, as described in the video.

I m sharing the solution that worked, for any other person that might be experiencing the same issue, or maybe for the videos too:

I played around with networking options left Bridged Adapter and enabled the Adapter 2, option Host-only Adapter, and now the interface gets an ip which is reachable from the host, but cannot connect to the internet.

Then I changed the Bridged Adapter to NAT with the Adapter 2 enabled in Host-only Adapter option and now i can ping the VM from host and go online.

Thank you for your help and support!

2 Likes

Great!
Thanks for sharing advice.

Thanks @msgeek Good to see that your issue got resolved. :+1:

Hi msgeek,
I want to enable the adaptor 2 option with the solution which you have mentioned but i don’t have adaptor 2 enabled for my VM template.

Can you please suggest and how can we enable this option.
BR
SK

Hello, you need to have the vm shutdown to be able to enable the 2nd adaptor, which is under Network. When it’s powered on it’s grayed out. When you power the VM off, you will see you can enable it by clicking the box!

What kind of error do you get, when you try to connect via SSH.

I could able to resolve the issue my self and have referred one video where 4 -5 steps are mentioned and it was related to firewall settings and re-installation of RSA key.

others facing this issue can refer it.