VirtualBox version: 6.0.6

Host OS: Windows 10

Guest OS: Ubuntu 18.04

How it's possible to setup VM so that I can ssh into VM from another server outside LAN? I have tried using NAT adapter and port forwarding, Bridged adapter and Host-Only settings but every time I try to ssh into my VM it responds with error.

ssh: ... Connection timed out

I have no problem to ssh into VM from my own computer using SSH.

  • 1
    Similar Questions have been Answered before : superuser.com/questions/424083/virtualbox-host-ssh-to-guest . – Christopher Hostage May 15 at 19:22
  • Hi, and welcome to SuperUser. It is going to be really hard to determine why it is not working, because it can go wrong at many stages. From firewalls with whitelists to improper port forwarding. If you set it to bridged, it will push the server into the LAN like your own pc. If at that point it still doesn't work, then the necessary ports are not open, or you are simply not accessing it through the right IP. Remember that when you switch to bridged, it will get an IP from the DHCP server in your network, so the IP changes. – LPChip May 15 at 19:46
  • @LPChip Yes, currently I have set to Bridged adapter and I have also added a firewall rule that allows port 22. And I'm pretty sure that IP i'm using is correct. Since I can ssh into my VM from host. – j.dawg May 15 at 20:06
  • 1
    On your router, you need to port forward 22 to the IP of the VM inside your network. – uSlackr May 15 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.