I have a set up running a windows 2008 server which hosts several virtual machines with their own IP addresses. Previously I was using nginx to proxy http requests to the correct virtual machine, for websites, and this worked without issue. Unfortunately, I have to remote desktop into the windows machine and use putty before I can access the ubuntu VM I'm interested in.

I'd like to find a way to ssh into my ubuntu VM directly from a remote computer (without RDPing into the host). I've created a traffic control rule in the windows server firewall allowing for inbound traffic on port 22236 and I'd like to use this port for ssh. Traffic requested on this port should forward to the VM's ip and port 22.

Is there anyway to accomplish this in Windows 2008 Server? I've tried looking up ways to do it with nginx but it seems dedicated to http traffic.


Solution: You have to attach the VirtualBox adapter to Bridged and assign an IP which should come under you LAN. These can be done inside network settings of corresponding virtual box. Only then, you can access the VirtualBox from outside machine.


Lets have some knowledge on attaching virtual box NIC in a network. here are four the cases.

  • Network Address Translation (NAT)
  • Bridged networking
  • Internal networking
  • Host-only networking

Network Address Translation (NAT): In NAT, the virtual box will get an IP address from the host machine(DHCP). Here the virtual box seems in a different network with respect to the host machine. Outside world can't access the virtual box. By default, new virtual boxes are attached to NAT.

Bridged networking: Here the virtual box will act as a separate machine in the LAN as the host machine. host machine and virtual machine will be in the same network. So the outside world can access the host machine. You should attach the network adapter to Bridged to ssh to your virtual box from another system in the LAN.

Internal networking: Here, if you have multiple virtual boxes in a host machine, all are attached to Internal, then they will be like in a separate network than the host, and entire communication among them stays within the host and
the communications are only visible to the VM's on that network.

Host only networking: Host-only Networking is like Internal Networking in that you indicate which network the Guest sits on. For example if two virtual boxes are under network named 'Network1', these can communicate each other as in the case of internal networking and additionally the Host can see them too. However, other external machines cannot see Guests on this network, hence the name "Host-only".

Reference: https://blogs.oracle.com/fatbloke/entry/networking_in_virtualbox1

Good Luck dude :)

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.