How to set up a ssh connection from Host to Guest VirtualBox

  1. VM’s Settings -> System -> check “Enable I/O APIC.”
  2. Shut the guest down, and use VirtualBox Settings to enable a second virtual network adapter, named (by default) vboxnet0.
  3. Inside Guest edit /etc/network/interfaces file or analogue and append the following lines:
    auto eth1
    iface eth1 inet dhcp
    
    

    or

    allow-hotplug eth1
    iface eth1 inet dhcp
  4. In Guest start the interface: ifup eth1
  5. Test ssh root@[ip address from ifconfig in Guest] from Host system.
  6. Make sure you have root login enabled in Guest /etc/sshd_config settings.