ssh-ing from OS X into a Linux on a local VM (VirtualBox)

  • for the specific virtual machine: Network Adapters / Port Forwarding / add a rule like “Protocol=>TCP, Host Port=>2222, Guest Port=>22, leave the IP addresses blank!”; the VirtualBox help system opens a nice and very instructive PDF manual, that really made me feel comfortable with this
  • this way you should actually be able to “ssh -p 2222 localhost” on the host machine
  • in my case this failed, complaining like this: “port 2222: Connection refused
  • it took me a while to reason, whether the guest OS really has an ethernet / LAN interface configured – and there wasn’t any such active interface – TBD
To be continued …

Update 2013-02-26:
“Bridged networking” looks superior to NAT, as things work far more easily – you don’t need to forwards ports (e.g. SSH), you can simply talk to the VM guests. I couldn’t get Samba working with NAT’s port forwarding, but with bridged networking “it’s just there” (what a joy!!!), and you can also have “natural” communication amongst the guests. Imagine: an Oracle DB within some VM …


Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.