Learned from stackoverflow that in virtualbox I have to change the adapter in the settings of the machine (turned off) to bridged adapter to be able to ssh into the box. Needed to know that.