Not able to ssh to the guest from host

Hello,

I’m trying to setup HomeLab using VirtualBox and I’m unable to ssh to the guest server(linux). Below are the steps done

  • I added virtual disk CentOs 9 version from the OSBoxes.org site
    image

  • I ran ip address command like below but this was not adding the broadcast (0.0.0.0)
    sudo ip addr add 192.168.1.15 dev enp0s3 ,
    so I ran the below one
    sudo ip addr add 192.168.1.15 broadcast 192.168.1.255 dev enp0s3

  • my sshd service is also running and listens to 0.0.0.0:22

What is that I’m doing wrong? I’m not sure on portmapping for this yet. Please help me with this

Hi @Sanjeev-Jyothikrishn,
What is the problem you are facing? Please share the error screenshot.

Regards,

1 Like

Hi @Tej-Singh-Rana,

Thank for reaching out. I couldn’t attach more than 1 images due to some restrictions and now it is lifted.

I was following Linux basics under Docker Pre-requisites and was in setting up Home Labs using Virtual Box. I’m using CentOS 9 as the exact VDI images tutor was using couldn’t be found in the OsBox.org site and used latest. I was able to set up VirtualBox and VM was created and I was able to do basic operations, but when I tried accessing VM from host using ssh, I wasn’t able to do so via putty or MobaXterm, that’s when I realized network isn’t accessible inside VM. Please find Screenshots of N/W settings and terminal commands below. Please let me know if you need any more info other than this.

  1. Network setting for VM (P.S. I’m using WiFi not wired)
    image

  2. Ifconfig


    ip addr show

  3. I then added ip address using below command.
    sudo ip addr add 192.168.1.15 dev enp0s3

I ran below to have broadcast as well instead of 0.0.0.0
sudo ip addr add 192.168.1.15 broadcast 192.168.1.255 dev enp0s3

  1. sshd service status is running

  2. tried ping google

  3. ssh using putty and mobaxterm

image

I’m not sure where I’m going wrong. I’m not able to proceed on Linux trainings further. I’m a rookie when it comes to Linux and Networking

Hi @Sanjeev-Jyothikrishn ,
I have seen a similar issue in the past.

Please check this post and follow the instructions.

1 Like

Hi @tsanghan
is this how I run it?

Have I setup default Gateway? – No, I was following what was taught in the classroom (Docker Pre-requisites)

I installed 6.1.46 version of Virtualbox
Installed cent0s 7 - 1804 version and after some troubleshooting, it worked for me