Unable to SSH centos from Mobaxtream

Hello, I have installed Virtual box and used centors image “CentOS 8.2.2004 (64bit)”.
My SSH is not working, I am getting warning as “Network error: Connection timed out”.

my settings are:

  1. attached to bridged network
  2. promiscuous mode = allow all
  3. Active(running) status I can see when checked ssh status in VM using command/ systemctl status sshd
  4. I cannot access internet as well to my vm

can you please help me what I missed.

Hello @PawanSingh,

Kindly try to execute the following command inside the VM and show me the output:
ping google.com

  1. need to change a setting in VirtualBox, change your Network Attached from Bridged Network to NAT.
  2. reboot your VM.
  3. run ifconfig -a and you should see the IP address then try again ping google.com

It’s still not working.

Try
$ sudo pkill dhclient
Then
$ sudo dhclient

this times it works. I have used sudo pkill dhclient and sudo dhclient.
I am able to ping google from my VM however I am unable to ssh from Mobaxtream.
I also like to mention I am not able to ping VM IP from my local machine which is 192.168.122.1

what did I miss now?

I would like to mention, I have tried NAT, NatNetwork(first enabled from preferences), Bridge but I am not able to access my VM from mobaxtream.

Hi KodeKloud, I am trying to fix this issue for the last 3 days, explored many videos on youtube and the web, and today one worked for me.
I have used NAT and added Port forwarding rule(Host IP: 127.0.0.1/2222 and Guest IP: 192.168.122.1/22).
then I have added 127.0.0.1 IP to the Mobaxtream/putty and it working.

I understand that putty first reaches 127.0.0.1 and then port is forwarded to the VM ip.

But my question is, why I can directly reach VM as I saw in your videos? where I did mistake.

Try below command in your CentOS machine.

ip addr show ////// All ip interface nodes should be up/running. If not, then run below command for each.

ifup

For example:
ifup enp0s3