SSHIntoVirtualBox

How to SSH into a local virtual box

Virtual Box... What's not to like? Now every OS, every weird combination is possible from the comfort of a single keyboard!

Case in point: I currently have a Netbsd virtual machine on my Mac Book Air. So nice to have a decent, stable, sane environement to change from the eye candy of Mac OS X... ;-)

This is just a simple visual "HOW TO", more of a reminder than anything else.

1. Check the vm network configuration:

This is more or less what you should be seeing:

http://www.gilandre.net/pix/config_lan_virtualbox01.png

The most important thing to remember is that your machine should be NAT-ted on your network.

Now, click on the Port Forwarding button and read on below...

2. Create a forwarding rule for SSH

http://www.gilandre.net/pix/config_lan_virtualbox02.png

Simple enough: create a forwarding rule from localhost, port 2244 to the SSH, port 22 of the Netbsd virtual machine.

And? That's it!!

3. SSH into your virtual machine

And it cannot be more simple:

http://www.gilandre.net/pix/ssh_into_virtualbox.png

The magic here, of course, is that port 2244 is going to redirect seamlessly to the local virtual machine.

SSH is now live, and you now have the best of both world... How easy is that? :-)

Hope this helps!