VirtualBox - SSH'ing Into a VM From an Outside Machine
Note: The terminology used below also applies to VMWare. The screens are different, but the issue and the solution are the same.
When creating a new VM through VirtualBox, you might have a problem SSH’ing into the box. You also might notice you get a 10.0.x.xx type address, even though the rest of your network is a 192.168.xx.xxx deal. Yes, the two are related.
Essentially what’s happening is the VM is sitting on it’s on little private line, where it can go out but nothing can reach it. By default, the network setting is “NAT”. If we want the VM to be accessible to the outside, we want to use Bridged networking.
This is easily solved, but requires that the VM be shut down. Go to the network second, pick an unused adapter (likely the 2nd one), enable it, and choose Bridged.
You should see this under the VM description now.
Go ahead and boot back into your VM. Fire up a terminal, run /sbin/ifconfig, and you’ll see you now have an ethernet adapter with an address you can reach.
Enjoy!If you found this post helpful, please consider sharing to your network. I'm also available to help you be successful with your distributed systems! Please reach out if you're interested in working with me, and I'll be happy to schedule a free one-hour consultation.