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.

1 Like

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

Hi,
A solution that works for me (Windows 10, VM VirtualBox 6.16, CentosOS 8 (64bit) ):

  1. VM attached to bridged network
  2. promiscuous mode = deny (but work for ‘allow all’ also)
    In terminal type:
    nmcli con up ‘enp0s3’
    After that find your IP address for enp0s3 with ifconfig and SSH to that IP…
1 Like

Chuka011… your solution worked for me.

Thanks for sharing.
However, can you explain what this command does?
nmcli con up ‘enp0s3’

I’m asking so that other’s could know when they follow these steps.

To start/up your Network Interface connection.

I tried this but it is erroring out like below

I am facing issues in getting ip address for bridged network
my virtual box not coming in full screen even after trying insert guest addition CD image. very hard to click right control every time . can someone help