This post is based on “Howto: SSH into VirtualBox 3 Linux Guests” by Stuart Colville, which I have updated to work for FreeBSD Guests: In older versions of VirtualBox one had to use a bridge interface to make this work. However, in newer versions; a virtual interface can be added to the Host by default, which make it way easier to access the guest machine through the host.

Usually, you have a primary network interface which uses NAT adapter, that one is needed for connecting to the Internet. What we are going to do is to add an additional interface to the guest machine. All you have to do is to access the settings of the guest when it is off.  Select Network->Adapter 2, then check the “Enable Network Adapter” as shown below. Change “attached to” to “Host-only Adapter” this will have the name vboxnet0 by default.

Now if you do ifconfing on your host machine (On Windows hosts use ipconfig), there will be a new interface called *vboxnet0 *(same as the virtual adapter name you just added). You will notice the IP address is something similar to this:

Which means his interface can access all the IP addresses in the following range: 192.168.56.1-192.168.56.254. This is needed to setup the guest interface properly.

Now, boot the FreeBsd guest. If you do *ifconfig on your guest machine, *You will notice that a second interface has been added to your machine (The name is *em1 *if you already had one interface). You have to configure the new interface; so you can access it by your host machine. We will set a static IP address for this interface using the IP range above.

Next add the following lines to “/etc/rc.conf” in your guest machine:

Save this and run the following command to restart the network interfaces:

If you have not enabled SSH on your FreeBsd guest yet, edit /etc/rc.conf and add the following:

and then run:

That’s it, now you should be able to ssh to your guest machine by: